Thalamus has asked for the wisdom of the Perl Monks concerning the following question:
I want to delete a section of text from a *.html file which contains this text. So, I have to treat it as a multi-line or whatever it is called.
<ADDRESS> someone@some.domain.co.uk </ADDRESS> </BODY> </HTML>
I feel I've tried everything ... -but obviously not, since I haven't figured it out yet. I want to take away the section between the start and end of the <ADDRESS> tag. If I try to take out only the <ADDRESS> it works - the regular expression for the email is also working (on their own), but once I try to do both at the same time I fail missearbly.
perl -i.bak -ne 'if(s!<ADDRESS>.(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})!!mgis) {next;} print;' index.html
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: one line regular expression - help needed
by Corion (Patriarch) on Jul 29, 2010 at 08:18 UTC | |
by morgon (Priest) on Jul 29, 2010 at 18:03 UTC | |
by Thalamus (Acolyte) on Jul 29, 2010 at 08:46 UTC | |
|
Re: one line regular expression - help needed
by marto (Cardinal) on Jul 29, 2010 at 08:27 UTC | |
by Thalamus (Acolyte) on Jul 29, 2010 at 08:47 UTC |