What regular expression for complex search and replace?

General questions about using TextPad

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

Post Reply
laetoli
Posts: 2
Joined: Fri May 21, 2004 9:44 am

What regular expression for complex search and replace?

Post by laetoli »

How do I change one or more upper case words followed by a colon and then a space or new line to the same enclosed by <b> and </b>?

For example -

Blah blah. RESULTS: Blah blah blah
to
Blah blah. <b>RESULTS: </b>Blah blah blah

and

Blah blah. MATERIALS AND METHODS: Blah blah blah
to
Blah blah. <b>MATERIALS AND METHODS: </b>Blah blah blah

and

Blah blah. CONCLUSIONS:
Blah blah blah
to
Blah blah. <b>CONCLUSIONS:
</b>Blah blah blah

Thanks,
Paul
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

Code: Select all

Find ([[:upper:]]([[:upper:]]| )+:)
Replace <b>\1</b>
I have used POSIX regular expression syntax, which can be selected from the Editor page of the Preferences dialog box. HTH
Then I open up and see
the person fumbling here is me
a different way to be
Post Reply