Page 1 of 1

All whitespace characters except \n...

Posted: Fri Feb 29, 2008 4:57 pm
by Ollie Saunders
How do I say match all whitespace characters except for \n.
I tried it with words - trying to match all word characters apart from "o":

[\w^o] : matched o anyway
[\w[^o]] : invalid

Re: All whitespace characters except \n...

Posted: Sat Mar 01, 2008 4:17 am
by GeertDD

Code: Select all

(?:\s(?<!\n))+
It looks ugly because it is ugly.

Re: All whitespace characters except \n...

Posted: Sat Mar 01, 2008 11:16 am
by Ollie Saunders
Yes it does.