Hi I have a variable in a Silex route and we only allow alphanumeric values
->assert('hash','\w+')
I would like to also allow a dot in the variable, but my efforts at editing this regex have failed. Help greatly appreciated, thanks!
Try using a character class ([…]
), like this:
[\w.]+
For example:
->assert('hash','[\w.]+')
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