in reply to Re^3: Problem with capturing all matches with regex in thread Problem with capturing all matches with regex
Yes, I've looked into the perlretut (or something, forgot) section. It said, that it's a new buggy feature.
But, I kind of dreamed of feature like that, because, I have one megapattern, in one of my programs, that I've had to create an entire subroutine for it to parse with many different regexes and ifs thenths, that spans for about 3 screen pages. I was hoping for a feature like this to make that pattern matching subroutine to make more consize.
I think, in that sub's case, I am targetting not the speed, but readability and managedness of the code :)
Re^5: Problem with capturing all matches with regex
by duelafn (Parson) on Oct 13, 2016 at 09:07 UTC
|
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
| [reply] |
|
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?
| [reply] |
|
| [reply] |
|
|