Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Regexp::Graph 0.01

by converter (Priest)
on Nov 24, 2001 at 23:11 UTC ( #127292=sourcecode: print w/replies, xml ) Need Help??
Category: Text Processing
Author/Contact Info converter

Regex::Graph provides methods for displaying the results of regular expression matches using a "decorated" copy of the original string,with various format-specific display attributes used to indicate the portion of the string matched, substrings captured, and for global pattern matches, the position where the pattern will resume on the next match.

This module encapsulates a regular expression pattern and a string against which the pattern is to be matched.

The `regshell' program (included with this distribution) demonstrates the use of the ANSI formatter module, and provides a handy tool for testing regular expressions and displaying the results. Other format modules are in the works, including a module to output text with HTML/CSS embedded styles.

regshell includes support for readline and history, and can save/load pattern/string pairs to disk files for re-use.

NOTE: I have not been testing this code on win32. The regshell program is not strict about paying attention to which terminal attributes are set, so it may go braindead on win32. I'll pay more attention to win32 on the next revision.

Regexp::Graph version 0.01 (includes the `regshell' program) is available for download at

A screenshot of the regshell program is available on the web page.


Replies are listed 'Best First'.
Re: Regexp::Graph 0.01
by larsen (Parson) on Nov 24, 2001 at 23:27 UTC
    Cool. However, I'd suggest to change its name: regular expressions are strictly related to finite automata, and finite automata to graphs. Reading Regex::Graph I thought it was a tool that converts a RE in a Graph representing the finite automata described by the RE.

    Maybe I'm supposed to provide a different name :). What about Regex::Graphic? (Regex::Fancy? :-) )

      Yes, the name is a problem. I'm open to suggestions.

        Regexp::Pretty::Results or Regexp::Results::Pretty?

        perl -p -e "s/(?:\w);([st])/'\$1/mg"

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: sourcecode [id://127292]
[Corion]: I guess I should not read some discussions on HackerNews - the crowd there is weirdly different - "you have to stay current in tech" (by following all the latest JS trends) is a meme there, but it doesn't really match my experience
[Corion]: At least in my area, experience can beat most new tech anyway because most new tech is just a rehash of things abandoned in the 70s and we still have a lot of that ;)
[Corion]: choroba: Ah, that will be next Friday for $work ;) Drinking enough water is key ;))
[Corion]: But then, maybe that's just my experience with things, and maybe Hacker News is just people much younger who haven't seen more than one tech cycle...
[choroba]: s/water/bear/ and s/enough/too much/
[choroba]: beer
[choroba]: oh ok
[marto]: I crashed the ScotLUG Christmas night, having never actually been to ScotLUG
[choroba]: Corion yeah, I probably already told you about how Bjarne Stroustrup was asked whether he still watched the new tech trends and what really impressed him
[choroba]: His reply was "I watch them, but I haven't been impressed in the last 10 years. There's been nothing new". That was 2 years ago :)

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2016-12-09 10:19 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (150 votes). Check out past polls.