PDA

View Full Version : find between words


docock
08-16-2007, 12:33 AM
Hi, I use the code below to fetch a html-page from the internet..
Now I want to store the words between lets say the words "welcome" "here"
into a variable..I think its done using grep ? I can't find the exact code though.. who can help me?

#!/usr/bin/perl
use LWP::Simple;
use HTML::Parse;
print "Content-type: text/html\r\n\r\n";
$html = get("http://www.mysite.com");

<< $thisvalue=grep ...?? (find in $html)

FishMonger
08-16-2007, 12:45 AM
You need to use a regex.

perldoc perlre
http://perldoc.perl.org/perlre.html

perldoc perlretut
http://perldoc.perl.org/perlretut.html