I am trying to make the user input exactly 4 characters with no spaces... here's what I have:
.[^\s]{4}
but everything I enter says that it didn't match the regex...
Where am I going wrong?
Why is there an extra .
in front? That will match a separate character before your "four non-spaces" get counted.
You probably also want to bind it to the beginning and end of the string, so:
^[^\s]{4}$
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