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