Regular expression without space b / w text

Please tell me how to check a regular expression without a space. b / w text.

+5
source share
2 answers

If you mean "What is a reqular expression to check for a blank space in a string", the following pattern will work:

^[\S]*$

This will find any line that contains only non-white space (spaces, new lines, tabs, etc.).

+28
source

I do not know if this is the regular expression that you are looking for, but [:space:]will match any space character, and [:blank:]will only match the space characters and tabs.

Both are used inside square brackets, for example. [[:space:]]

+1

All Articles