grep regex is not always JavaScript regex
grep may use basic regular expressions, extended regular expressions with -E, or PCRE-style syntax with -P when available. Those dialects do not share every feature, escape rule, flag, or Unicode behavior with JavaScript.
Common differences to check
- Named capture groups are supported by modern JavaScript but not by standard grep modes.
- Lookbehind, Unicode properties, and lazy quantifiers depend on the grep mode and implementation.
- Shell quoting changes how backslashes and special characters reach grep.
Use this tool accurately
The Regex tester evaluates JavaScript (ECMAScript) expressions. It is useful for learning the shared concepts, but it is not a claim of grep-engine compatibility. Test production grep commands in the command environment that will run them.