`/^[A-Za-z_]\w*$/` with JS's ASCII `\w`.
()
| 88 | |
| 89 | /// `/^[A-Za-z_]\w*$/` with JS's ASCII `\w`. |
| 90 | fn ascii_ident_re() -> &'static Regex { |
| 91 | static RE: OnceLock<Regex> = OnceLock::new(); |
| 92 | RE.get_or_init(|| Regex::new(r"^[A-Za-z_][0-9A-Za-z_]*$").unwrap()) |
| 93 | } |
| 94 | /// String-callable simple-name shape (`/^[A-Za-z_][A-Za-z0-9_]*$/`). |
| 95 | fn simple_callable_re() -> &'static Regex { |
| 96 | static RE: OnceLock<Regex> = OnceLock::new(); |