you are using asterisk which suggest that whitespace may not be present: use /\s+/ instead (this validates whitespace) to validate a void entry use the empty() function.
jazz090 wrote:you are using asterisk which suggest that whitespace may not be present: use /\s+/ instead (this validates whitespace) to validate a void entry use the empty() function.
Shouldn't /\s*/ cover those cases (empty, single and multiple spaces)? I tried your suggestion but the program is still exhibiting the same behavior as before.
No, that regex wil match any string. Because any string has "zero or more white space characters" in it. You'll probably want to "anchor" the start- and end-of-line in your regex: