A little Regex problem
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
A little Regex problem
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?
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
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...
You did, of course, look under "Regular Expressions" in the help...