Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re^5: Problem with capturing all matches with regex

by duelafn (Parson)
on Oct 13, 2016 at 09:07 UTC ( #1173916=note: print w/replies, xml ) Need Help??

in reply to Re^4: Problem with capturing all matches with regex
in thread Problem with capturing all matches with regex

At that point (three pages of parsing regexps), I think you are well into the territory where you should use a grammar engine. For instance, Parse-RecDescent, or my preferred, Marpa-R2

Good Day,

  • Comment on Re^5: Problem with capturing all matches with regex

Replies are listed 'Best First'.
Re^6: Problem with capturing all matches with regex
by igoryonya (Pilgrim) on Oct 15, 2016 at 07:20 UTC
    Seams, like grammar engine is a cool thing, but I am not getting it.
    I've read descriptions and readmes about both libraries that You've suggested, but the only thing that I can find, is that they are for source code parcing.
    Looked at term "grammar engine" on the inet and on wikipedia. Found nothing useful, and pretty much the same, as what I've said above.
    How is it compared to regex?

      Grammars are for parsing data, not just code (which is a subset of data). For example, see from the Parse::RecDescent demo directory.

        I looked at demos and documentation of that lib. It was over my head. I didn't understand anything.
        Tried to do some more searches about grammar engine on various search engines and tech portals, but didn't find any sane explanation of what it is, how it works and what it's used for. I just can't figure out, how it works and how I can utilize it.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2022-12-05 23:49 GMT
Find Nodes?
    Voting Booth?

    No recent polls found