A little Regex problem

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Xover
Posts: 7
Joined: Fri Apr 23, 2004 3:33 pm

A little Regex problem

Post 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?
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post 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...
Post Reply