Java regex for any symbol? -
is there regex accepts symbol?
edit: clarify i'm looking for.. want build regex accept number of whitespaces , must contain atleast 1 symbol (e.g , . " ' $ £ etc.) or (not exclusive or) @ least 1 character.
yes. dot (.) match symbol, @ least if use in conjunction pattern.dotall flag (otherwise won't match new-line characters). docs:
in dotall mode, expression . matches character, including line terminator. default expression not match line terminators.
regarding edit:
i want build regex accept number of whitespaces , must contain atleast 1 symbol (e.g , . " ' $ £ etc.) or (not exclusive or) @ least 1 character.
here suggestion:
\s*\s+ \s*number of whitespace characters\s+1 or more ("at least one") non-whitespace character.
Comments
Post a Comment