How to replace the following text

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
dave maheshwari
Posts: 4
Joined: Wed Feb 08, 2012 6:35 am

How to replace the following text

Post by dave maheshwari »

I have a text of format ABCD-1234 appear randomly in the page
I can search all such using the following regular expression
[A-Z][A-Z][A-Z][A-Z]-[0-9][0-9][0-9][0-9]
however i want to replace the same with
My preceding bla bla text ABCD-1234 My ending bla bla text

How do i do that

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

Post by ben_josephs »

Use "Posix" regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
Search | Replace... (<F8>):
Find what: [A-Z]{4}-[0-9]{4}
Replace with: My preceding bla bla text \0 My ending bla bla text

[X] Regular expression

Replace All
Post Reply