JavaScript Identifier Regular Expression
JSON →The `identifier-regex` package provides a precise regular expression function, `identifierRegex()`, designed to match valid JavaScript identifiers according to the ECMAScript specification. This includes proper handling of reserved words and specific syntax rules. The current stable version is 1.0.1, focusing on correctness and stability rather than rapid feature additions. Its primary differentiator is its strict adherence to JavaScript identifier rules, offering an `exact` option to control whether the regex matches the entire string or finds identifiers within a larger text. It explicitly excludes global properties like `Infinity` from being considered valid identifiers, aligning with common usage expectations. This library is ideal for parsers, linters, or any application needing to validate or extract JavaScript identifiers reliably.
Traffic · last 30 days ↑200% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇮 Finland · 🇩🇪 Germany