I want to use the Regex to validate the string containing
[a-z0-9_.]
I use the /^[\w\s\-.]*$/
to validate the string. But it allows the first character like (._)
Why don't you just stick to your requirements ?
[a-z]
[a-z0-9_.]
-> your regex: /^[a-z][a-z0-9_.]*$/
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