regular expression do not allow empty string code example Example: regex to check non empty string /^(?!\s*$).+/