-
-
Notifications
You must be signed in to change notification settings - Fork 276
Roadmap
Steven Levithan edited this page Sep 15, 2015
·
195 revisions
See version history for released versions.
The following changes have been completed and are available via the latest build here on GitHub:
-
New feature: Unicode addons: Added the new flag
A
(A for "astral"), which opts-in to full 21-bit Unicode support for\p
and\P
(i.e., code points up toU+10FFFF
, rather than the default upper limit ofU+FFFF
). This extended support applies to all Unicode categories, scripts, blocks, and properties that include astral code points. FlagA
also enables support for scripts and blocks that include only astral code points, and disables the use of\p
and\P
within character classes (a descriptive error is thrown). This is because JavaScript character classes can match code units only, not code points. In astral mode, use e.g.(\p{L}|[0-9_])
rather than[\p{L}0-9_]
. Thanks to Mathias Bynens for providing the supporting data. (#25, #29, #33) -
New feature: Added feature
'astral'
toXRegExp.install
/uninstall
/isInstalled
. RunningXRegExp.install('astral')
implicitly sets the new flagA
for all regexes. (#28) -
New feature: Added function
XRegExp.replaceEach
for batch replacements. (#20) -
New feature: Added function
XRegExp.match
, as a re-implementation ofString.prototype.match
that gives you the result types you actually want, lets you override flagg
and ignorelastIndex
, and fixes browser bugs. (#32) - New feature: XRegExp-All: Can now be loaded as a RequireJS AMD module that creates no globals. (#38)
-
New feature: XRegExp-All: Can now be imported in Node.js using
require('xregexp')
, as an alternative to the CommonJS-compatiblerequire('xregexp').XRegExp
. -
New feature: Unicode addons: Single-letter Unicode categories can now be referenced without curly brackets, e.g.,
\pL
or\PL
. (#15) -
New feature: New ES6 regex flag
u
(unicode
) can now be used where it is supported natively. (#98) -
New feature: Added the
reparse
option to theXRegExp.addToken
options object, which allows simplified syntax and flag tokens. (#18) -
New feature: Added the
leadChar
option to theXRegExp.addToken
options object, which can provide a significant performance improvement when applicable. -
New feature: Added properties
<regexp>.xregexp.source
and<regexp>.xregexp.flags
, which provide access to the original pre-compilation input pattern and flags of regexes created by XRegExp. (#70) -
New feature: Added function
XRegExp.cache.flush
for improved control during performance testing. -
Fine tuning: Major performance optimization for creating regexes. (Pattern caching, token
leadChar
checks, #24, etc.) -
Fine tuning: Major performance optimization for
XRegExp.cache
. (No string concat) -
Fine tuning: Major performance optimization for copying regexes with
XRegExp
andXRegExp.globalize
. (Native constructor, #24, etc.) -
Fine tuning: Major performance optimization for
XRegExp.exec
/test
/replace
/forEach
/split
. (#23, etc.) - Fine tuning: Unicode addons: Updated Unicode data from version 6.1.0 to 7.0.0. [Mathias Bynens] (#39, #73)
-
Fine tuning: Unicode addons: Moved character data for Unicode category
L
(akaLetter
) from Unicode Base to Unicode Categories. -
Fine tuning: Unicode addons: Changed the format for providing Unicode data, via
XRegExp.addUnicodeData
. (#29) -
Fine tuning:
XRegExp.forEach
no longer accepts or returns its context. Can now use binding instead, for the provided callback. -
Fine tuning: Replaced
XRegExp.addToken
'strigger
andcustomFlags
options with newflag
andoptionalFlags
options that provide easier-to-use replacements for the same functionality. -
Fine tuning: Removed the
this.hasFlag
function previously available within token definition functions. In its place, you can use the new third argument (flags
) that is passed into token handler functions. -
Fine tuning: Using the same name for multiple named capturing groups in a single regex is now a
SyntaxError
. (#22) -
Fine tuning: Removed the
'all'
shortcut used byXRegExp.install
/uninstall
. (#27) - Fine tuning: XRegExp now overwrites itself when loaded twice, rather than silently skipping the script. (#17)
-
Fine tuning: Explicitly define a global
XRegExp
object to allow usage in Meteor 0.6.5 and higher. (#55) -
Fine tuning: Removed
'extensibility'
as an installable/uninstallable option, since it did little more than add hassle for addons. The functionality it provided is now always available. -
Fix: XRegExp.matchRecursive addon: When given
valueNames
, thevalue
andname
properties in results were reversed. (#26) -
Fix: XRegExp.build addon: A trailing unescaped
$
in subpattern definitions was stripped even when a leading^
wasn't present. (#35) -
Fix: A
ReferenceError
is now thrown when accessing an unknown backreference viaXRegExp.matchChain
. -
Fix: A
TypeError
is now thrown whenXRegExp.replace
/split
are given anull
orundefined
subject string, and whenString.prototype.replace
/split
/match
are called onnull
orundefined
context when overridden byXRegExp.install('natives')
and in ES5 strict mode. -
Fix: A
SyntaxError
is now thrown if the reserved wordslength
or__proto__
are used as capture names. - Fix: A quantifier now applies to the preceding token when separated by a combination of both inline comments and free-spacing.
-
Fix: In edge cases,
XRegExp.cache
didn't treat a forward slash in the list of flags as an error. - Other: Harmonized the version numbers for XRegExp and its official addons.
- Other: Removed the BackCompat and Prototypes addons.
- Other: Converted all QUnit unit tests to Jasmine, and added several thousand new tests.
-
Other: Added performance tests in
tests/perf/
. -
Other: Added a
.editorconfig
file for consistent coding styles between different editors. [Mathias Bynens]
There are a few minor breaking changes that shouldn't affect most people and have easy workarounds. See the full change log above for more details about these changes.
-
XRegExp.forEach
no longer accepts or returns its context. Use binding with the provided callback instead. - Moved character data for Unicode category
L
(Letter
) from Unicode Base to Unicode Categories. This has no effect if you're already using Unicode Categories or XRegExp-All. - Using the same name for multiple named capturing groups in a single regex is now a
SyntaxError
. - Removed the
'all'
shortcut used byXRegExp.install
/uninstall
. - Removed the Prototypes addon, which added methods
apply
,call
,forEach
,globalize
,xexec
, andxtest
toXRegExp.prototype
. - A few changes affect custom addons only: Changed the format for providing custom Unicode data, replaced
XRegExp.addToken
'strigger
andcustomFlags
options with newflag
andoptionalFlags
options, and removed thethis.hasFlag
function previously available within token definition functions.
Open a new issue here on GitHub, or fork the repo and start hacking.