Regexp exclusions

Ideas for new features

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

Post Reply
acogan
Posts: 2
Joined: Tue Sep 23, 2003 5:00 pm

Regexp exclusions

Post by acogan »

First, I confess I haven't read through all the posts on this forum, and further I'm not a regexp master.

That said, I'd like the pattern exclusion in TextPad enhanced so that you can specify not to match a string, rather than just single chars. Right now, you can exclude a list or a range of individual characters. Like, to not match x, y, or z:

Code: Select all

[^x-z]
What I'd like to see is some type of extension that would let me exclude a string of chars, like:

Code: Select all

[^"foo"]
Of course, the problem with the above is that you'd really need some escaped character instead of normal quotes, but hopefully you get the idea.
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Expressions already exist to help with that, but TextPad does not support them at this time. That could probably be done by adding the 4 lookaround expressions of:
Positive lookahead (?=.....) successful if it can match to the right

Negative lookahead (?!.....) successful if it can NOT match to the right

Positive lookbehind (?<=.....) successful if it can match to the left

Negative lookbehind (?<!.....) successful if it can NOT match to the left
Using these in conjunction with word boundary expressions \< and \> should provide an additional level of Search/Replace functions.

Add a poll, I would definitely vote for this.
Post Reply