GT2/GT2-Android/node_modules/xregexp/package.json

96 lines
13 KiB
JSON
Raw Normal View History

{
"_args": [
[
{
"raw": "xregexp@2.0.0",
"scope": null,
"escapedName": "xregexp",
"name": "xregexp",
"rawSpec": "2.0.0",
"spec": "2.0.0",
"type": "version"
},
"/home/jdaugherty/work/GT2/GT2-Android/node_modules/ftp"
]
],
"_defaultsLoaded": true,
"_engineSupported": true,
"_from": "xregexp@2.0.0",
"_id": "xregexp@2.0.0",
"_inCache": true,
"_location": "/xregexp",
"_nodeVersion": "v0.6.18",
"_npmUser": {
"name": "slevithan",
"email": "steves_list@hotmail.com"
},
"_npmVersion": "1.1.21",
"_phantomChildren": {},
"_requested": {
"raw": "xregexp@2.0.0",
"scope": null,
"escapedName": "xregexp",
"name": "xregexp",
"rawSpec": "2.0.0",
"spec": "2.0.0",
"type": "version"
},
"_requiredBy": [
"/ftp"
],
"_resolved": "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz",
"_shasum": "52a63e56ca0b84a7f3a5f3d61872f126ad7a5943",
"_shrinkwrap": null,
"_spec": "xregexp@2.0.0",
"_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/ftp",
"author": {
"name": "Steven Levithan",
"email": "steves_list@hotmail.com"
},
"bugs": {
"url": "https://github.com/slevithan/XRegExp/issues"
},
"dependencies": {},
"description": "Extended JavaScript regular expressions",
"devDependencies": {
"qunit": ">= 0.2.x"
},
"directories": {},
"dist": {
"shasum": "52a63e56ca0b84a7f3a5f3d61872f126ad7a5943",
"tarball": "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz"
},
"engines": {
"node": "*"
},
"homepage": "http://xregexp.com/",
"keywords": [
"regex",
"regexp"
],
"license": "MIT",
"main": "./xregexp-all.js",
"maintainers": [
{
"name": "walling",
"email": "bwp@bwp.dk"
},
{
"name": "slevithan",
"email": "steves_list@hotmail.com"
}
],
"name": "xregexp",
"optionalDependencies": {},
"readme": "[XRegExp](http://xregexp.com/)\r\n==============================\r\n\r\nXRegExp provides augmented, extensible, cross-browser JavaScript regular expressions. You get new syntax and flags beyond what browsers support natively, along with a collection of utils to make your client-side grepping and parsing easier. XRegExp also frees you from worrying about pesky inconsistencies in cross-browser regex handling and the dubious `lastIndex` property.\r\n\r\nXRegExp supports all native ES5 regular expression syntax. It's about 3.5 KB when minified and gzipped. It works with Internet Explorer 5.5+, Firefox 1.5+, Chrome, Safari 3+, and Opera 9.5+.\r\n\r\n\r\n## Performance\r\n\r\nXRegExp regular expressions compile to native RegExp objects, thus there is no performance difference when using XRegExp objects with native methods. There is a small performance cost when *compiling* XRegExps. If you want, however, you can use `XRegExp.cache` to avoid ever incurring the compilation cost for a given pattern more than once. Doing so can even lead to XRegExp being faster than native regexes in synthetic tests that repeatedly compile the same regex.\r\n\r\n\r\n## Usage examples\r\n\r\n~~~ js\r\n// Using named capture and flag x (free-spacing and line comments)\r\nvar date = XRegExp('(?<year> [0-9]{4}) -? # year \\n\\\r\n (?<month> [0-9]{2}) -? # month \\n\\\r\n (?<day> [0-9]{2}) # day ', 'x');\r\n\r\n// XRegExp.exec gives you named backreferences on the match result\r\nvar match = XRegExp.exec('2012-02-22', date);\r\nmatch.day; // -> '22'\r\n\r\n// It also includes optional pos and sticky arguments\r\nvar pos = 3, result = [];\r\nwhile (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\\d+)>/, pos, 'sticky')) {\r\n result.push(match[1]);\r\n pos = match.index + match[0].length;\r\n} // result -> ['2', '3', '4']\r\n\r\n// XRegExp.replace allows named backreferences in replacements\r\nXRegExp.replace('2012-02-22', date, '${month}/${day}/${year}'); // -> '02/22/2012'\r\nXRegExp.replace('2012-02-22', date, function (match) {\r\n return match.month + '/' + match.day + '/' + match.year;\r\n}); // -> '02/22/2012'\r\n\r\n// In fact, all XRegExps are RegExps and work perfectly with native methods\r\ndate.test('2012-02-22'); // -> true\r\n\r\n// The *only* caveat is that named captures must be referred to using numbered backreferences\r\n'2012-02-22'.replace(date, '$2/$3/$1'); // -> '02/22/2012'\r\n\r\n// If you want, you can extend native methods so you don't have to worry about this\r\n// Doing so also fixes numerous browser bugs in the native methods\r\nXRegExp.install('natives');\r\n'2012-02-22'.replace(date, '${month}/${day}/${year}'); // -> '02/22/2012'\r\n'2012-02-22'.replace(date, function (match) {\r\n return match.month + '/' + match.day + '/' + match.year;\r\n}); // -> '02/22/2012'\r\ndate.exec('2012-02-22').day; // -> '22'\r\n\r\n// Extract every other digit from a string using XRegExp.forEach\r\nXRegExp.forEach('1a2345', /\\d/, function (match, i) {\r\n if (i % 2) this.push(+match[0]);\r\n}, []); // -> [2, 4]\r\n\r\n// Get numbers within <b> tags using XRegExp.matchChain\r\nXRegExp.matchChain('1 <b>2</b> 3 <b>4 a 56</b>', [\r\n XRegExp('(?is)<b>.*?</b>'),\r\n /\\d+/\r\n]); // -> ['2', '4', '56']\r\n\r\n// You can also pass forward and return specific backreferences\r\nvar html = '<a href=\"http://xregexp.com/\">XRegExp</a>\\\r\n <a href=\"http://www.google.com/\">Google</a>';\r\nXRegExp.matchChain(html, [\r\n {regex: /<a href=\"([^\"]+)\">/i, backref: 1},\r\n {regex: XRegExp('(?i)^https?://(?<domain>[^/?#]+)'), backref: 'domain'}\r\n]); // -> ['xregexp.com', 'www.google.com']\r\n\r\n// XRegExp.union safely merges strings and regexes into a single pattern\r\nXRegExp.union(['a+b*c', /(dogs)\\1/, /(cats)\\1/], 'i');\r\n// -> /a\\+b\\*c|(dogs)\\1|(cats)\\2/i\r\n~~~\r\n\r\nThese examples should give you the flavor of what's possible, but XRegExp has more syntax, flags, utils, options, and browser fixes that aren't shown here. You can even augmen
"readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git+https://github.com/slevithan/XRegExp.git"
},
"scripts": {
"test": "node tests/node-qunit.js"
},
"version": "2.0.0"
}