Hi I have a regular expression which allows only letters and some characters (.-) and whitespace. The problem is that I want it to pass even when the textfield is empty. The \s requires a space, which is fine, but I want it to pass without any keyboard input as well. Here it is:
^[\sA-Za-z.-]+$
Change
+quantifier to*, and you are done: –It will match
0 or moreoccurrences. And0occurrence will mean empty string.