Hi people, I have this regex?
I want the field to start with alphanumeric and allow single white spaces (or no white spaces) zero or more times and zero or more times in the sentence and then end with alphanumeric.
For example:
1. Hello John123
2. Hello John123 (with maybe 3 spaces between hello and John 123)
3. Hello John123 how are you
Help would be appreciated!
Code:
/^[a-zA-Z0-9]+[\s]*[a-zA-Z0-9]+$/
For example:
1. Hello John123
2. Hello John123 (with maybe 3 spaces between hello and John 123)
3. Hello John123 how are you
Help would be appreciated!
Comment