Reputation: 10207
This might be a silly question but is there a Regular Expression to validate for blanks
or no user input at all?
Upvotes: 3
Views: 13725
Reputation: 62908
Start of line immediately followed by end of line:
^$
Any amount of whitespace, including none:
^\s*$
Upvotes: 9
Reputation: 473873
^$
should do the trick. ^
matches the beginning and $
the end of the string.
Upvotes: 4