RE "STANDALONE[^_]" not working

General questions about using TextPad

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

Post Reply
tn7077
Posts: 5
Joined: Tue Sep 26, 2006 4:59 pm

RE "STANDALONE[^_]" not working

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

Post 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
tn7077
Posts: 5
Joined: Tue Sep 26, 2006 4:59 pm

Post by tn7077 »

Thanks, Ben.
Post Reply