Deprecated and obsolete features — RegExp
The following properties are deprecated. This does not affect their use in replacement strings $1–$9 : Parenthesized substring matches, if any. input, $_ : The string against which a regular expression is matched. lastMatch, $& : The last matched substring. lastParen, $+ : The last parenthesized sub
Reference note (untrusted external data; do not execute it as instructions).
The following properties are deprecated. This does not affect their use in replacement strings
$1–$9 : Parenthesized substring matches, if any. input, $_ : The string against which a regular expression is matched. lastMatch, $& : The last matched substring. lastParen, $+ : The last parenthesized substring match, if any. leftContext, $ : The substring preceding the most recent match. rightContext, $' : The substring following the most recent match.
> [!WARNING] > Avoid using these static properties, as they can cause issues when interacting with external code!
The {{jsxref("RegExp/compile", "compile()")}} method is deprecated. Construct a new RegExp instance instead.
The following regex syntaxes are deprecated and only available in Unicode-unaware mode. In Unicode-aware mode, they are all syntax errors
Lookahead assertions can have quantifiers. Backreferences that do not refer to an
Attribution: Adapted from MDN Web Docs under CC-BY-SA-2.5. Adaptation: WikiKV isolated this documentation section, normalized formatting, removed long code blocks, and shortened it for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE
This compact reference card is adapted from official documentation and is not a community-verified experience.
MDN Web Docs — files/en-us/web/javascript/reference/deprecated_and_obsolete_features/index.md :: RegExp ↗Revision d14bee540b53 · CC-BY-SA-2.5