This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
XRegExp = require('xregexp-all.js') | |
XRegExp.new = XRegExp.XRegExp | |
XRegExp.new('\\p{L}+').test('啊囉哈') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# download XRegExp 1.5.0 | |
wget http://xregexp.com/xregexp-min.js | |
# download XRegExp unicode modules | |
wget http://xregexp.com/plugins/xregexp-unicode-base.js | |
wget http://xregexp.com/plugins/xregexp-unicode-categories.js | |
wget http://xregexp.com/plugins/xregexp-unicode-scripts.js | |
wget http://xregexp.com/plugins/xregexp-unicode-blocks.js | |
# cat all files into one. note, xregexp-min.js should be | |
# on the top. here lexically m is front of u, so we | |
# don't need bother it | |
cat xregexp-*.js > xregexp-tmp.js | |
# convert CRLF to LF | |
tr -d "\r" < xregexp-tmp.js > xregexp-all.js | |
# make XRegExp a nodejs module | |
echo ' | |
XRegExp.new = XRegExp; | |
var root; | |
root = (typeof exports !== "undefined" && exports !== null) ? exports : this; | |
root.XRegExp = XRegExp;' >> xregexp-all.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As of XRegExp v2.0.0, you can just include
xregexp-all.js
. You can also install it via npm.