imag/libimagentrytag/src/util.rs

5 lines
130 B
Rust

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