Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: A line of code matches the question

by SuicideJunkie (Vicar)
on Aug 10, 2017 at 15:07 UTC ( #1197178=note: print w/replies, xml ) Need Help??

in reply to A line of code matches the question

Presumably you mean a "regular expression"?

The most basic thing is you probably want multiline mode with a /m

And odds are you're going to want an XML parser to make your life easier when someone changes minor details in the file. I recommend XML::Tiny which great for most use cases and has no dependencies.

  • Comment on Re: A line of code matches the question

Replies are listed 'Best First'.
Re^2: A line of code matches the question
by *2 (Novice) on Aug 10, 2017 at 15:48 UTC
    Yes, I would like to match all the contents of the following <div id = "724">. Also I have not used XML :: Tiny, match the content I am not sure, I can not use xml, I match is Can not change the content. But want trying to get a match with a regular match., / M I tried, it seems not work. What should I do?
      You should NOT USE REGULAR EXPRESSIONS to parse HTML. Just don't do it. If you have a good-enough solution that uses two regular expressions, you should NOT try to combine it into one regular expression. Regexes are bad at parsing structured data like HTML, and rapidly become incomprehensible and unmaintainable when you try.
        I am also a headache for those very long expressions, if you can, then I also like to change the problem simple. Thank you for your suggestion!

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (1)
As of 2021-10-17 01:11 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (70 votes). Check out past polls.