JavaScript Identifier Regular Expression

JSON →
library 1.0.1 ·javascript
verified May 27, 2026

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.

total hits 13
actors 6 distinct systems
last hit 1d ago Bingbot
MetaBot
4
GPTBot
2
Script
1
Search engines
1

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇮 Finland · 🇩🇪 Germany