Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Pathologically Eclectic Rubbish Lister
 
PerlMonks

Regexp::Graph 0.01

by converter (Priest)
 | Log in | Create a new user | The Monastery Gates | Super Search | 
 | Seekers of Perl Wisdom | Meditations | PerlMonks Discussion | 
 | Obfuscation | Reviews | Cool Uses For Perl | Perl News | Q&A | Tutorials | 
 | Poetry | Recent Threads | Newest Nodes | Donate | What's New | 

on Nov 24, 2001 at 23:11 UTC ( #127292=sourcecode: print w/ replies, xml ) Need Help??

Category: Text Processing
Author/Contact Info converter
Description:

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 http://dalnet-perl.org/converter/.

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

conv

Comment on Regexp::Graph 0.01
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"

Back to Code Catacombs

Login:
Password
remember me
What's my password?
Create A New User

Node Status?
node history
Node Type: sourcecode [id://127292]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (30)
BrowserUk
Corion
GrandFather
jdporter
Your Mother
toolic
holli
Gavin
atcroft
LTjake
kennethk
MidLifeXis
thezip
Eyck
pileofrogs
clinton
AnomalousMonk
socketdave
lima1
metaperl
lostjimmy
Cristoforo
ssandv
flamey
MikeDexter
cmg
jimbend
smile4me
im2
plieberg
As of 2010-02-09 20:06 GMT
Sections?
The Monastery Gates
Seekers of Perl Wisdom
Meditations
PerlMonks Discussion
Categorized Q&A
Tutorials
Obfuscated Code
Perl Poetry
Cool Uses for Perl
Perl News
Information?
PerlMonks FAQ
Guide to the Monastery
What's New at PerlMonks
Voting/Experience System
Tutorials
Reviews
Library
Perl FAQs
Other Info Sources
Find Nodes?
Nodes You Wrote
Super Search
List Nodes By Users
Newest Nodes
Recently Active Threads
Selected Best Nodes
Best Nodes
Worst Nodes
Saints in our Book
Leftovers?
The St. Larry Wall Shrine
Offering Plate
Awards
Craft
Snippets Section
Code Catacombs
Quests
Editor Requests
Buy PerlMonks Gear
PerlMonks Merchandise
Planet Perl
Perlsphere
Use Perl
Perl.com
Perl 5 Wiki
Perl Jobs
Perl Mongers
Perl Directory
Perl documentation
CPAN
Random Node
Voting Booth?

What level of existential comfort do you require?

Palace
Executive suite at the best hotel
Regular hotel in a decent part of town
Motel
Boarding house
Sleeping Bag on Couch in Basement
Any port in a storm
Camping under the freeway overpass
Jail
Other

Results (279 votes), past polls