Page 1 of 1

RE "STANDALONE[^_]" not working

Posted: Tue Sep 26, 2006 6:30 pm
by tn7077
I used RE "STANDALONE[^_]" (RE enabled in the Find menu) to search.
The problem is that "STANDALONE" is not found if it is at the end of a line.

For example,
#define STANDALONE
#define INCLUDE_STANDALONESYM_TBL

With RE "STANDALONE[^_]", "STANDALONE" is found for the second line only.

Is this a bug or is there some assumptions I missed?

Posted: Tue Sep 26, 2006 7:06 pm
by ben_josephs
That is correct. [^_] matches any single character that isn't newline and isn't _.

If you want to find each occurrence of STANDALONE that is followed by a character that isn't _ or that is at the end of a line, use STANDALONE([^_]|$).

This assumes you are using Posix regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax

Posted: Tue Sep 26, 2006 7:12 pm
by tn7077
Thanks, Ben.