On Jan 4, Lawrence Liew said:

>I would like to match the following text (of different lines but standrad
>text) using regex.

This is rather vague.  Do you want to delete each block of text between an
<RD> and an <HR> tag?

><RD><BD+><PT:15>Status of this document<HR>
[...]
><RD><PT:11>Copyright in this document is reserved to the Crown in right of
>the State of Western Australia. Reproduction except in accordance with
>copyright law with the consent of the Attorney General is prohibited.<HR>

If so, I suggest something like:

  $text =~ s/<RD>.*?<HR>//gs;

The /g modifier means "do this as many times as possible" and the /s
modifier means "allow . to match a newline."

If you also want to get rid of the newlines after the <HR>, you can add a
\n* to the end of the regex.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to