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

Re: Tell or determine whichever Perl regex group fails

by bliako (Monsignor)
on Jan 04, 2022 at 13:27 UTC ( #11140133=note: print w/replies, xml ) Need Help??


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

  • Comment on Re: Tell or determine whichever Perl regex group fails

Replies are listed 'Best First'.
Re^2: Tell or determine whichever Perl regex group fails
by etj (Hermit) on Jan 04, 2022 at 18:17 UTC
        You wouldn't extend this module, because it does what it's supposed to. What you're describing would be achieved by getting the graph object back, then mutating it with further inputs from somewhere, like the regex debugger mentioned elsewhere here.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (1)
As of 2022-05-22 13:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (80 votes). Check out past polls.

    Notices?