in reply to Tell or determine whichever Perl regex group fails
There exists GraphViz::Regex which visualises a regex as a graph.
My idea was to visualise what happens to that graph when an input string is run against the regex. And then find unvisited or failed nodes. Sorry, that's a rough sketch. Whatever the way, I don't know how to do that. BUT! there is re_graph.pl which claims to not only visualise a regex but also visualise it when run against some input, see the example parsing perl comments. The author is Steve Oualline. Unfortunately I did not manage to get that example to work.
Update: along the lines of the above rough sketch I found (again I think?) this online regex visualiser https://blog.robertelder.org/regular-expression-visualizer/ which shows that it is visible. Anonymous Monk has a way to conveniently extract all the info from running the regex against some input: Re: Tell or determine whichever Perl regex group fails
bw, bliako
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tell or determine whichever Perl regex group fails
by etj (Priest) on Jan 04, 2022 at 18:17 UTC | |
by bliako (Abbot) on Jan 05, 2022 at 17:24 UTC | |
by etj (Priest) on Jan 06, 2022 at 23:59 UTC |