Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
XRegExp = require('xregexp-all.js') = XRegExp.XRegExp'\\p{L}+').test('啊囉哈')
# download XRegExp 1.5.0
# download XRegExp unicode modules
# 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;
var root;
root = (typeof exports !== "undefined" && exports !== null) ? exports : this;
root.XRegExp = XRegExp;' >> xregexp-all.js

This comment has been minimized.

Copy link

@slevithan slevithan commented May 27, 2012

As of XRegExp v2.0.0, you can just include xregexp-all.js. You can also install it via npm.


This comment has been minimized.

Copy link
Owner Author

@godfat godfat commented May 28, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment