Comparing version 1.5.2 to 1.5.3
{ | ||
"name" : "xregexp", | ||
"version" : "1.5.2", | ||
"version" : "1.5.3", | ||
"description" : "The one of a kind JavaScript regular expression library.", | ||
@@ -5,0 +5,0 @@ "author": "Steven Levithan <steves_list@hotmail.com>", |
@@ -22,32 +22,37 @@ | ||
var XRegExp = require('xregexp').XRegExp; | ||
console.log('Héllö Wôrld'.match(XRegExp('\\p{L}+'))); | ||
var date = XRegExp('(?<year> [0-9]{4}) -? # year \n\ | ||
(?<month> [0-9]{2}) -? # month \n\ | ||
(?<day> [0-9]{2}) # day ', 'x'); | ||
var match = date.exec('2011-06-30'); | ||
if (match) { | ||
console.log(match.day); | ||
} | ||
```javascript | ||
var XRegExp = require('xregexp').XRegExp; | ||
console.log('Héllö Wôrld'.match(XRegExp('\\p{L}+'))); | ||
var date = XRegExp('(?<year> [0-9]{4}) -? # year \n\ | ||
(?<month> [0-9]{2}) -? # month \n\ | ||
(?<day> [0-9]{2}) # day ', 'x'); | ||
var match = date.exec('2011-06-30'); | ||
if (match) { | ||
console.log(match.day); | ||
} | ||
``` | ||
For CoffeeScripters: | ||
{XRegExp} = require 'xregexp' | ||
console.log 'Héllö Wôrld'.match XRegExp '\\p{L}+' | ||
date = XRegExp ''' | ||
(?<year> [0-9]{4}) -? # year | ||
(?<month> [0-9]{2}) -? # month | ||
(?<day> [0-9]{2}) # day | ||
''', 'x' | ||
match = date.exec '2011-06-30' | ||
console.log match.day if match | ||
```coffeescript | ||
{XRegExp} = require 'xregexp' | ||
console.log 'Héllö Wôrld'.match XRegExp '\\p{L}+' | ||
date = XRegExp ''' | ||
(?<year> [0-9]{4}) -? # year | ||
(?<month> [0-9]{2}) -? # month | ||
(?<day> [0-9]{2}) # day | ||
''', 'x' | ||
match = date.exec '2011-06-30' | ||
console.log match.day if match | ||
``` | ||
Changelog | ||
--------- | ||
* 1.5.3: Fixed problems with NPM package. | ||
* 1.5.2: Updated to support require("xregexp").XRegExp, which is the future method. | ||
@@ -54,0 +59,0 @@ * 1.5.1: Several bugs fixed and updated to use Unicode 6.1 character database (instead of 5.2). |
Sorry, the diff of this file is not supported yet
95
83258
4
1243