JS `/^[A-Za-z_]\w*$/` (ASCII \w — the regex crate's \w is Unicode).
()
| 66 | } |
| 67 | /// JS `/^[A-Za-z_]\w*$/` (ASCII \w — the regex crate's \w is Unicode). |
| 68 | fn simple_ident_re() -> &'static Regex { |
| 69 | static RE: OnceLock<Regex> = OnceLock::new(); |
| 70 | RE.get_or_init(|| Regex::new(r"^[A-Za-z_][0-9A-Za-z_]*$").unwrap()) |
| 71 | } |
| 72 | /// extractStaticMemberRef's capitalized-receiver test. |
| 73 | fn capitalized_re() -> &'static Regex { |
| 74 | static RE: OnceLock<Regex> = OnceLock::new(); |