This works nice, but I got a lot of white spaces. Also, for some reason, I was getting an extra <\\b> in addition to the STRING_I_WANT. Easy to take out, but seem my question at the bottom if you could. #2:local $/ = "<br>"; while ( <DATA> ) { print $1 if /Title:(.*?)<br>/s; }
I actually assumed this would be the easiest way. I tried:$whole_file =~ /Title:.*?</b>(.*?)<br>/ms;
The only thing this got me was the whole file printed out. :(undef $/; chomp($whole_file = <IN>); $whole_file =~ s/.*?Title:.*?<\/b>(.*?)<br>/$1/ ; print "$whole_file";
This worked well. It would print out the whole line if it found something that fit in the range description. But I'm curiuos on one thing on this and the first example - how would I put the value into a variable when using thewhile ( <DATA> ) { print if /<b>/ .. /<br>/; }
Thanks for your help. I'm making some progress but I'm still "in the books", so there's quiet a few tricks I've still yet to learn.print if /<b>/ .. /<br>/;
In reply to Re: Re: Help with getting everything from X until Y
by Anonymous Monk
in thread Help with getting everything from X until Y
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |