I’m stuck on a regex problem. I want to match things that are not a whitespace or a newline.
Not whitespace is simply:
[^ ]
does not mean not whitespace or newline is:
[^( |\n)]
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No,
means “any character that’s neither a space, a
(, a), a|, or a newline.The
[]is called a character class. It matches a single character from a list, optionally negated with the^at the beginning.What you want is
(or
\Sif you also want to exclude line feeds, form feeds and tabs from the range of legal matches).