Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Parsing HTML tags with regex

by jithoosin (Scribe)
on Nov 11, 2005 at 09:23 UTC ( #507672=note: print w/ replies, xml ) Need Help??


in reply to Re: Parsing HTML tags with regex
in thread Parsing HTML tags with regex

Hi gopal,
THANK YOU VERY MUCH. I won the bet .But now i am in bit of trouble. I donot know how to explain the working to my friends.So could you PLEASE explain the working of the regular expression.Once again THANK YOU VERY MUCH GOPAL.

Replies are listed 'Best First'.
Re^3: Parsing HTML tags with regex
by gopalr (Priest) on Nov 11, 2005 at 10:09 UTC
    m# < ## start with < ( ## group start [^">]+ ## text but Not match " and > (?:"[^"]+")* ## if " found, match till end quote found. Its optional [^>]+ ## text but Not match and > ) ## group end > ## End with > #
      Hi gopal,
      There is a problem if the input string is my $line = "<select name=\"url><23\" style=\"width><A125px\"  >";
      .But i think a slight modification to your previous answer will do the job then #$line =~ m#<([^">]+(?:"[^"]+")*)*[^>]+>#; IS there any problem.Also provide me an asnwer for the question about <!--->---> thing

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2016-07-30 09:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (265 votes). Check out past polls.