Page 1 of 1

What regular expression for complex search and replace?

Posted: Fri May 21, 2004 10:07 am
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

Posted: Fri May 21, 2004 10:35 am
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