Reputation: 1041
I have this simple regular expression, and I'm testing it on RegExr.
^(?<name>[a-z0-9\-]+)
It should give me an associative array with a name
field that matches strings that contains a-z
and 0-9
.
But I get the ?
character underlined in red with that error.
Why?
Upvotes: 4
Views: 4737
Reputation: 70732
Well unfortunately, RegExr v2 is dependent on the JS RegExp implementation, which does not support named capture groups. See your working regular expression at regular expressions 101
Upvotes: 4