Regex empty string or email

The Solution to Regex empty string or email is


This regex pattern will match an empty string:

^$

And this will match (crudely) an email or an empty string:

(^$|^.*@.*\..*$)

~ Answered on 2011-02-21 09:02:03


Most Viewed Questions: