Something wrong with regex?
Posted: Mon Nov 01, 2010 12:48 pm
Hi
Am I doing something wrong? I can't get Find>Regular expressions to match what I want using the 'Character Class Operators'.
if I create a new document, and enteron the first line, then use the find tool to search for
it matches what I would expect; 0, 1, 2, 3 and 4, but if I search for it matches d and g in abcdefg.
Likewise, if I put a space in the 'Find what' box, it correctly matches the space in the text, but if I search forit matches a, c and e in abcdefg.
I have checked that 'Find>Regular expression' is ticked and 'Preferences>Editor>Use POSIX regex syntax' is not ticked.
Do I have to escape the Character Class Operators? I've triedbut it doesn't match anything.
Thanks
Nick
Am I doing something wrong? I can't get Find>Regular expressions to match what I want using the 'Character Class Operators'.
if I create a new document, and enter
Code: Select all
01234 abcdefgCode: Select all
[0-9]Code: Select all
[:digit:]Likewise, if I put a space in the 'Find what' box, it correctly matches the space in the text, but if I search for
Code: Select all
[:space:]I have checked that 'Find>Regular expression' is ticked and 'Preferences>Editor>Use POSIX regex syntax' is not ticked.
Do I have to escape the Character Class Operators? I've tried
Code: Select all
\[:space:]Thanks
Nick