Is there a regex which accepts any symbol?
EDIT: To clarify what I’m looking for.. I want to build a regex which will accept ANY number of whitespaces and the it must contain atleast 1 symbol (e.g , . ” ‘ $ £ etc.) or (not exclusive or) at least 1 character.
Yes. The dot (
.) will match any symbol, at least if you use it in conjunction withPattern.DOTALLflag (otherwise it won’t match new-line characters). From the docs:Regarding your edit:
Here is a suggestion:
\s*any number of whitespace characters\S+one or more (“at least one”) non-whitespace character.