in reply to to get next line of pattern matched
In a much as I will not recommend using regex to parse HTML doc., however, for this you could use Look-Around Assertions like so:
use warnings; use strict; my $str = "<div class='PlayVideo'></div> A8A <div class='RadioButtonClipStyle'>"; if ( $str =~ m#(?<=</div>)(.+?)(?=<div.+?>)#s ) { print $1; ## prints A8A }
If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: to get next line of pattern matched
by ansh batra (Friar) on Jan 07, 2013 at 11:00 UTC | |
by marto (Cardinal) on Jan 07, 2013 at 11:02 UTC | |
by ansh batra (Friar) on Jan 07, 2013 at 11:04 UTC |
In Section
Seekers of Perl Wisdom