Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I recently redone the template of my web site and I have these hugs articles that have 30+ replacements I'd have to do to each of them. It'd take 10-15 hours to do it manually.
I want to write a small perl script to substitute this chunk of HTML
With<blockquote> <DIV class=code_box> <DIV class=code_box_header><font size="2" face="Verd +ana, Arial, Helvetica, sans-serif">code</font></DIV> <font size="2" face="Verdana, Arial, Helvetica, sans +-serif">all other text and stuff goes here</font></DIV> </blockquote>
The thing is, I need to capture the stuff inside the 2nd font tag and apply the above blockquote and pclass to it.<BLOCKQUOTE> <p class="style2">all other text and stuff goes here</p> </BLOCKQUOTE>
I can open up my 300+ html files and slurp them up just fine but my regex skills aren't that good to match these multilines while capturing only the text/code in the second font tag (there will always be just 2 if it matches).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: huge multiline regex
by wfsp (Abbot) on Jun 23, 2006 at 03:42 UTC | |
|
Re: huge multiline regex
by davido (Cardinal) on Jun 23, 2006 at 02:18 UTC | |
| |
|
Re: huge multiline regex
by GrandFather (Saint) on Jun 23, 2006 at 02:28 UTC | |
|
Re: huge multiline regex
by rsriram (Hermit) on Jun 23, 2006 at 06:05 UTC |