uhop / node-re2

node.js bindings for RE2: fast, safe alternative to backtracking regular expression engines.
Other
493 stars 53 forks source link

Flags passed as a separate argument will be lost if pattern is a regexp literal #191

Closed gost-serb closed 11 months ago

gost-serb commented 1 year ago

The following method of regexp creation doesn't work:

var x = new RE(/foo/, 'gim');

while the same combination of arguments works in standard RegExp

uhop commented 1 year ago

For now, use a string as the first argument. You can get it from a regular expression object too.