TooTallNate / pcre-to-regexp

Converts PCRE regexp strings to JavaScript RegExp instances
MIT License
22 stars 6 forks source link

Get wrong result when I test a string #2

Open JaggerH opened 7 years ago

JaggerH commented 7 years ago

I have a pattern, which doesn't work as expect. `
var pattern = PCRE('/^\s[-+]?[0-9].?[0-9]+([eE][-+]?[0-9]+)?\s*$/'); console.log(pattern.test('25,45')) // true, expect to be false

console.log(/^\s[-+]?[0-9].?[0-9]+([eE][-+]?[0-9]+)?\s*$/.test('25,45')) // false ` I think this is a serious error. I found this error when I try to use some PHP pattern in my JS code. Hope you can fix it.