Thread: RegEx
View Single Post
Old 12-12-2011, 12:31 PM   #1
el.motar
Junior Member
el.motar began at the beginning.
 
el.motar's Avatar
 
Posts: 6
Karma: 10
Join Date: Nov 2009
Location: Asturias
Device: Handlin
RegEx

Hi Bookworms.

I am having a problem with a RE expression and wonder if anyone could shed some light on the problem.

I am trying to replace the div tags with h3 tags around the second headers of a book with lots of those, I think around 198 in total, bit tedious by hand.

The headers are all upper-case and normally one space between words, this is my search string with minimal matching selected.

<p class="western1">([^a-z]+[^¿][A-Z]+[\s].*)</p>

This does select the headers but I can not figure out how to store the test contents of the headers.

I seem to end up with only a part of the header, have tried to include up to 5 round brackets "(" and use the \1 to \5 to replace the contents but not luck.

Would appreciate any help from the experts.

ATB

el.motar
el.motar is offline   Reply With Quote