Regular Expression WhiteSpace excluding newline

Possible duplicate:
Match spaces, but not newlines (Perl)

I need to search for an expression using a Perl-style regular expression in every line that matches a specific pattern, surrounded by an arbitrary number of spaces, tabs, ff, etc. (i.e. whitespace) characters. But I want to limit this to one line. My own program logic will go to the next line. If I use [\ s] * in my regular expression, it always matches a new line. This is annoying.

Is there a way to force \ s to exclude a new line (\ n and \ r)? I want my code to be able to be used in ANSI and UNICODE files, so I want to use the standard metacharacters as much as possible, and not list all possible candidates for spaces (in Unicode there are some additional characters read as spaces, and I don't want to know , details. \ s should take this into account automatically, except that it also matches a new line).

+3
source share

All Articles