View Single Post
Old 04-25-2010, 10:49 PM   #1
prky
Member
prky began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Nov 2009
Device: IPhone 3GS
Multiline Regex?

I'm having trouble with trimming a multi-line regex from a pdf.

The PDF is Ancestor by Scott Sigler, available free online: http://media.libsyn.com/media/scotts...cottSigler.pdf

Looking at it in the Regex builder, I see blocks like:


Code:
Pearcy pointed to another phone, this one built into the equipment-thick control panel. </p><p>
Order your copy from Amazon.com on April 1: Noon Eastern Time, 9AM Pacicific</p><p>
<a href="http://www.amazon.com/Ancestor-Scott-Sigler/dp/1896944736">http://www.amazon.com/Ancestor-Scott-Sigler/dp/1896944736</a></p><p>
Ancestor ~ Scott Sigler</p><p>
“That’s a straight line to Langley. Just pick it up and it will ring through.” </p><p>
I want to trim

Code:
^Order your copy.*Ancestor ~ Scott Sigler</p><p>$
If I use:

Code:
(?mi)^Order.*$
It highlights the line:

Code:
Order your copy from Amazon.com on April 1: Noon Eastern Time, 9AM Pacicific</p><p>
Which is expected.

But the minute I try multiple lines, it fails. Eg, If I use:

Code:
(?mi)^Order.*1896944736
It highlights nothing.

How can I get a regex to match:

Code:
Order your copy from Amazon.com on April 1: Noon Eastern Time, 9AM Pacicific</p><p>
<a href="http://www.amazon.com/Ancestor-Scott-Sigler/dp/1896944736">http://www.amazon.com/Ancestor-Scott-Sigler/dp/1896944736</a></p><p>
Ancestor ~ Scott Sigler</p><p>
?

Ta,

prk.
prky is offline   Reply With Quote