Re:RegExpBuilder – Create regular expressions using chained ...
by marktangotango on Wednesday February 11, 2015 @11:52AM
(#9033885)
Generally, I find that if one's regexes are so complex that one needs visualizers or other aids in writing them, one doesn't have a regex problem, but a parsing problem. The method of parsing by recursive descent can often lead to much more understandable (if more verbose) "pattern matching".
[ Parent
| on HN ]
Re:RegExpBuilder – Create regular expressions using chained ...
by otakucode on Wednesday February 11, 2015 @06:00PM
(#9036279)
The worst regexes I've had to write involved parsing the various IMDB data files, which seem to have been formatted specifically to make them as difficult to parse as possible. I hear mediawiki syntax is similarly arcane and evil, but I've never tried to parse it (though last night I started writing some tools to deal with wikipedia dumps so I might end up in that corner). I'd really like to see different approaches to parsing really ugly formats that feature an exception to almost every single pattern you think you've found. I honestly think the regex is easiest...
Re:RegExpBuilder – Create regular expressions using chained ...
by DenisM on Wednesday February 11, 2015 @12:25PM
(#9034121)
Recursive descend is imperative, while regex is declarative.
Regex may be ugly, but you lose something important when you move from declarative to imperative.
Re:RegExpBuilder – Create regular expressions using chained ...
by jerf on Wednesday February 11, 2015 @12:59PM
(#9034356)
"Recursive descent" has that name precisely because it is not the only parsing alternative, hence we can not simply call it "parsing".
Re:RegExpBuilder – Create regular expressions using chained ...
by raiph on Thursday February 12, 2015 @11:58AM
(#9039792)
Perl 6 unifies "regexes" and recursive descent. See https://news.ycombinator.com/item?id=9039680 or, say, https://github.com/Mouq/json5/blob/master/lib/JSON5/Tiny/Gra...