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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With