search/replace prefix and suffix with wildcards between

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
DKSE
Posts: 2
Joined: Thu Nov 29, 2007 9:14 am

search/replace prefix and suffix with wildcards between

Post by DKSE »

Hi everybody!

How can I search/replace with wildcards in a text like this:

ABCDEFGHxx100zzPQRSTUVWXYZ
ABCDEFGHIJKLMNOPQRSTUVWXYZ
ABCDEFGHIxx200zzQRSTUVWXYZ
ABCDEFGHIJKLMNOPQRSTUVWXYZ
ABCDEFGHIJKLMNOPQRSTUVWXYZ
ABCDEFGHIJKLMxx300zzUVWXYZ
ABCDEFGHIJKLMNOPQRSTUVWXYZ
xx400zzHIJKLMNOPQRSTUVWXYZ
ABCDEFGHIJKLMNOPQRxx500zzZ

search/replace xx???zz ==> aa???cc should work like this

xx100zz ==> aa100cc
...
xx500zz ==> aa500cc

Is this possible?

Dirk
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Are there exactly 3 characters between the xx and the zz in each case? If so:
Find what: xx(...)zz
Replace with: aa\1cc

[X] Regular expression

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

[X] Use POSIX regular expression syntax
DKSE
Posts: 2
Joined: Thu Nov 29, 2007 9:14 am

Post by DKSE »

That works fine -- thanks a lot ben_josephs!
Post Reply