imag/libimagentrytag/src/util.rs

6 lines
135 B
Rust
Raw Normal View History

2016-02-04 13:01:33 +00:00
use regex::Regex;
pub fn is_tag(s: &str) -> bool {
2016-02-04 13:01:33 +00:00
Regex::new("^[a-zA-Z]([a-zA-Z0-9_-]*)$").unwrap().captures(&s[..]).is_some()
}