in reply to Re: Help with getting everything from X until Y
in thread Help with getting everything from X until Y
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>/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Help with getting everything from X until Y
by rob_au (Abbot) on May 29, 2003 at 05:21 UTC | |
|
Re: Re: Re: Help with getting everything from X until Y
by perrin (Chancellor) on May 29, 2003 at 13:18 UTC | |
by CountZero (Bishop) on May 29, 2003 at 19:41 UTC |