JP Vossen on 14 May 2008 08:37:20 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] regex question

> Date: Tue, 13 May 2008 19:11:19 -0400
> From: "John Sladek" <>
> I'm new to regex and I am trying to use it with mod_rewrite.  There is tons 
> of stuff out on the web but I figured someone here might be able to get this 
> answered quicker than I can find it on my own.

I know you already figured out a solution, but as an FYI I am a big fan 
of "The Regex Coach" at  The latest 
versions only run on Windows, but older versions run on Linux.  There 
are also a few other similar tools you can Google for [1].

The tool gives you two panes, and you put a string target in one and a 
Perl compatible regular expression (PCRE) in the other.  You then get 
real-time feedback on whether the pattern matches, back references, a 
stepping tool and more.  I do a lot of regexp at work and this is a 
really great tool.

Also, O'Reilly's _Mastering Regular Expressions_ is *the* definitive 
work on the subject and is an awesome book.  This is required reading if 
you want to really learn regexps.

Having said all that, I'm not 100% sure of mod_rewrite uses PCRE or some 
other flavor.  I suspect it's PCRE but can't swear to it.

[1] Hum, just for fun I checked the Hardy repo and found these:

kodos - A visual regular expression editor
kregexpeditor - graphical regular expression editor plugin for KDE
redet - regular expression development and execution tool
visual-regexp - Interactively debug regular expressions

JP Vossen, CISSP            |:::======|        jp{at}jpsdomain{dot}org
My Account, My Opinions     |=========|
"Microsoft Tax" = the additional hardware & yearly fees for the add-on
software required to protect Windows from its own poorly designed and
implemented self, while the overhead incidentally flattens Moore's Law.
Philadelphia Linux Users Group         --
Announcements -
General Discussion  --