Page 1 of 1

A little Regex problem

Posted: Mon Dec 20, 2004 9:49 am
by Xover
When I want to search for all whitespaces, I try this: '\s+' but Textpad always finds only the letter 'S', capital or not. Why that, what am I doing wrong?

Posted: Mon Dec 20, 2004 10:58 am
by ben_josephs
It doesn't recognise "\s" as a character class expression. It does recognise the Posix almost-equivalent "[[:space:]]" (which includes vertical tab; "\s" doesn't), but that's broken: it doesn't include "\r" or "\n". Basically, you can't search for either a space (or anything else) or a newline. Take the time to try the various possibilties. You'll be amused by a variety of weird and wonderful bugs.

You did, of course, look under "Regular Expressions" in the help...