1.2.0 – 2009-10-20
- Fine tuning: Removed
RegExp.prototype.execAll since it is trivial to implement using RegExp.prototype.forEachExec.
- Fine tuning: XRegExp is no longer reliant on the global object being named
window, which allows it to be used in nonbrowser contexts.
- Fix: Duplicate flags caused an error in Firefox 3.5.1 and later.
- Fix: When replacement strings contained backreferences to nonparticipating groups,
"undefined" was inserted into the returned string in IE.
1.1.0 – 2009-07-04
- New feature: A bug in IE where the
lastIndex property of regexes created with the /g flag is not always reset to zero after running String.prototype.replace or String.prototype.match is now fixed automatically.
- New feature: A bug in Firefox, IE, Safari, and Chrome where the
lastIndex property of a regex is not updated during String.prototype.replace iterations (visible within replacement functions) is now fixed automatically.
- Fix:
String.prototype.split and String.prototype.replace now consistently work with non-string context (this).
- Fix: The empty character class
[] caused incorrect results in some edge cases in Firefox only, due to a Firefox bug in handling empty negative lookahead.
1.0.1 – 2009-06-26
- Fix: A leading zero is now allowed in two-digit
$nn backreferences in replacement text.
- Fix: Several other bugs with
String.prototype.replace were also fixed, mostly edge-case issues introduced in v1.0.
1.0.0 – 2009-06-24
- New feature:
XRegExp.addToken function.
- New feature:
XRegExp.freezeTokens function.
- New feature:
XRegExp.isRegExp function.
- New feature:
XRegExp.matchWithinChain function.
- New feature:
RegExp.prototype.validate method.
- New feature:
RegExp.prototype.forEachExec method.
- New feature:
RegExp.prototype.execAll method.
- New feature: The
${⋯} replacement text token now supports numbered backreferences (and thereby offers an otherwise-unavailable way to separate backreferences from literal numbers), in addition to named backreferences. This follows prior art in .NET, etc.
- New feature: Consistent cross-browser, ES3-compliant handling of $-prefix metasequences in replacement text when performing a replacement using a non-regex search value.
- New feature: Automatically fix incorrectly incremented
lastIndex properties after zero-length matches are found by RegExp.prototype.test (already performed for RegExp.prototype.exec and String.prototype.match).
- New feature:
XRegExp.version property.
- Fine tuning: Rewrote XRegExp's core to work with user-extendable regex syntax tokens.
- Fine tuning: Code cleanup, performance tweaks, and improved documentation.
- Fine tuning: Removed the
XRegExp.matchRecursive function (now a plugin).
- Fine tuning: Removed handling for native, infinitely-nesting character class intersection syntax (proposed for ES4 but not included in ES5).
- Fine tuning: Removed
XRegExp.addPlugin, which was hard-coded to work with the Unicode plugin only. If you use this plugin, download an updated version (v0.3 or higher).
- Fix: The
limit argument of String.prototype.split is now followed consistently.
- Fix: Types are now detected correctly for variables created in a frame other than where XRegExp is run.
- Fix:
$n tokens in replacement text are now limited to two digits, even when there are more than 99 capturing groups in your regex. Use ${nnn} for three or more digit backreferences.
0.6.1 – 2008-08-01
- Fine tuning: Tweaked the barebones plugin architecture.
0.6.0 – 2008-07-23
- Fine tuning: Added support for the first plugin: Unicode.
- Fix: When using
String.prototype.split, if the last match of the separator within the subject string ended at the end of the string, and the separator was capable of matching an empty string (e.g. /a?/), a trailing empty string value was not appended to the result array even when the separator did not match an empty string in that last case. This followed Firefox's native handling, but not the spec (which at least Opera follows correctly).
0.5.2 – 2008-05-14
- Fix:
XRegExp.matchRecursive could not return more than one match when the sticky (y) and global (g) modifiers were combined without using valueNames.
0.5.1 – 2008-04-21
- Fix:
RegExp.prototype.addFlags did not preserve previously applied, non-native modifiers (v0.5 only).
0.5.0 – 2008-04-20
- New feature:
XRegExp.matchRecursive function.
- New feature:
XRegExp.escape function.
- New feature:
XRegExp.cache function.
- New feature:
RegExp.prototype.call/apply methods.
- New feature: Comment pattern syntax:
(?#⋯).
- New feature: Consistent cross-browser, ES3-compliant
String.prototype.split method.
- New feature: Automatically fix incorrect
RegExp.prototype.exec and String.prototype.match return values for nonparticipating capturing groups.
- New feature: Automatically fix incorrectly incremented
lastIndex properties after zero-length matches are returned by RegExp.prototype.exec and String.prototype.match.
- Fine tuning: Changed named capture syntax from
(<name>⋯) to (?<name>⋯), which is the standard syntax in .NET, Perl, and PCRE, and under consideration for ES4.
- Fine tuning: Named capture is now always available; no more
k modifier.
- Fine tuning: Support for native, infinitely-nesting character class intersection syntax proposed for ES4.
- Fine tuning: Support for native sticky (
y) and extended (x) modifiers. Sticky mode will be in JS1.8; both are proposed for ES4.
- Fine tuning: Passing a
RegExp object to the XRegExp constructor now returns a new copy, like the native RegExp constructor.
- Fine tuning: Removed
XRegExp.overrideNative. The RegExp constructor cannot be overriden in JS1.8 or current ES4 proposals.
- Fine tuning: Changed handling of empty character classes to follow ES3 cross-browser.
0.2.2 – 2007-07-12
- Fix: Safari 3 is now supported, after working around a WebKit parser bug.
0.2.1 – 2007-07-09
- Fix: XRegExp now works after being loaded twice (but you shouldn't do that).
0.2.0 – 2007-07-08
- New feature: Comprehensive named capture support, activated using the new
k modifier.
- Capture:
(<name>⋯)
- Backreference in regex:
\k<name>
- Backreference in replacement text:
${name}
- Returned as:
result.name, or arguments[0].name in replacement functions
- New feature:
RegExp.prototype.addFlags method.
- Fine tuning: Removed the
XRE global object. XRE.overrideNative is now XRegExp.overrideNative.
- Fine tuning: The
x modifier now ignores whitespace between a regex token and its quantifier, rather than collapsing it to (?:).
0.1.0 – 2007-05-30 (initial release)
- Dotall (
s, aka singleline) modifier.
- Free-spacing (
x, aka extended) modifier.
- Consistent cross-browser handling for leading, unescaped
] in character classes.
XRE.overrideNative function, which applies these regex extensions to the RegExp constructor.