named-regexp.js
named-regexp.js copied to clipboard
The object returned by named function seems to be stateful
It seems like that the object created via named functions cannot be used multiple time.
Consider following simple example:
var named = require("named-regexp").named;
var name = "hello.world"
var e = named(/(:<first>hello)\.(:<second>world)/ig)
console.log(!!e.exec(name))
console.log(!!e.exec(name))
console.log(!!e.exec(name))
Returns:
true
false
true
Of course I would expect that each exec returns "true"