debugger

R

robertospara

Hi.
I am involved in work under project that will visualize the process of
matching the regex to input text.
As data to highlight sub-regexes which take a part in each step of
matching I want to use perl debugger output from regex compilation (
perl -e '-re debug; $text =~/regex/'). In the doc file perldebguts is
very less information about subregexes position in regex that are
already use in matching process. If someone every wanted to do that
could have said the same. My question: Eny ideas to get out from
debugger output elements that I could highlight in each step to
visualize matching process.

My last idea was that I could take from offsets (look in perldebguts if
don't know what I mean) the position where sub-regex is ending for
example :

my_regex == son((mother)?father*)+daughter

| | |

13 20 22
So positions 13, 20, 22 I receive from debugger. Then I should write
parser of my regex to get positions :
- beginning of sub-regex "(mother)?"
- beginning of sub-regex "father*"
- beginning of sub-regex "((mother)?father*)+".

I don't see for now any other way. Any clues nice welcome. Best regards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top