CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
strip

 



grigp
New User

Dec 24, 2010, 2:54 AM

Post #1 of 2 (306 views)
strip Can't Post

text:

<span class="footer-link-separator">|</span><a class="bodlink" href="/corporate/mediaoffer.html">Oferta media</a></span>&nbspand&nbsp;<span class="mtxt">class="bodlink" href="/corporate/mediaoffer.html">Oferta media</a><span class="footer-link-separator">|</span>

How to strip all text starting with first <a class="bodlink"...... and ending with second .........Oferta media</a>

Thanks


rovf
Veteran

Dec 27, 2010, 7:05 AM

Post #2 of 2 (283 views)
Re: [grigp] strip [In reply to] Can't Post

You need non-greedy matching here:

$x =~ s/foo.*?bar.*?bar//

will remove that part from $x which starts with foo and ends with the second bar.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives