Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Think about Loose Coupling
 
PerlMonks  

Re: to get next line of pattern matched

by 2teez (Priest)
on Jan 07, 2013 at 09:25 UTC ( #1011988=note: print w/ replies, xml ) Need Help??


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


Comment on Re: to get next line of pattern matched
Download Code
Re^2: to get next line of pattern matched
by ansh batra (Friar) on Jan 07, 2013 at 11:00 UTC

    your solution is correct but the file i am parsing contains many div tag
    can you please provide the more specific solution

      Since you're having so many problems achieving this with a regex, have you considered taking the previous advice of using a HTML Parser?

        ill surely consider that advice but i am about to complete something and at this point i am trying not to add any module to this if this is achivable using regular expressions

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1011988]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (12)
As of 2014-04-16 19:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (433 votes), past polls