Tired of debugging your regular expressions ? Do you want to quickly build efficient regexps ?
Visual REGEXP is for you !
This software will let you design your regexps by letting you type the expression and visualize its effect on a sample of your choice.

The screenshots below illustrate this concept (click to enlarge):


Standalone for Windows

To following executable is a standalone program. Just download it, and run it! See the README file for some informations.

visual_regexp-3.0.exe (828 Ko)

visual_regexp-3.1.exe (1189 Ko)

User get customize the program by adding a file visual_regexp.ini in the same directory as the executable. Here is a sample of such a file showing all the parameters the user can modify.

Tcl/Tk script

In order to run this program, you need to have Tcl/Tk 8.3.0 (or later) for version 3.0 or Tcl/Tk 8.5a4 for version 3.1 installed (click here to download it). To get the version of an already installed version of Tcl/Tk, run 'wish' and type 'set tk_version'.

Get visual_regexp-3.0.tar.gz (23 Ko)

Get visual_regexp-3.1.tcl (23 Ko)

Contact the author for any bug or suggestion :
User preferences : Some preferences (colors, geometry) can be modified by editing the script and changing the value of the variables (see comment to get variable meaning).

Known problems

Links & tutorial on Regular Expressions

The best tutorial on regexp in this article written by Jan Borsodi, author of the Regexplorer tool which does the same job as VisualREGEXP.

An other nice tutorial from Microsoft here.

A quick reference card (contributed by Gordon McKinney) here


Future I welcome your suggestions !
-- new version done by Martin Lemburg. Many thanks, Martin.
-- it is now a tcl 8.5a4 starpack
-- GUI layout changed to be based on a paned window
-- GUI code looks different, to be more ergonomic
-- the informational labels (replacements & matches) are now sunken
-- there are now additional the "first" and "last" navigation buttons
-- there is a new option to navigate through matches or matches and submatches
-- the displayed count of matches is changed to display the current and the count of matches used for navigation (probably changes, if the new navigation option is changed)
-- the replace widget is disabled on startup
-- the tcl console is added to the help menu
-- the key bindings inside the regexp text widget changed a bit to allow for expanded regexp (-expanded or (?x)) to contain tabs and newlines. Tabs are created with Control-Tab and newlines with Control-Return. Additional with Control-C|V|X (not c|v|x) it is possible to use the clipboard like with Control|Shift-Insert, Shift-Delete.
-- Bugfix: parsing of command line when file name contained spaces was incorrect.
-- New history windows to get a trace all the expressions tried
-- New 'Clear' button to clear the Regexp (not cleared automatically after 'Select' anymore)
-- Better navigation (Tab and Shift-Tab to change focus, use Ctrl+Tab to insert actual tab)
-- New bindings: Ctrl+w = insert \w, Ctrl+s = insert \s, ...
-- Allow escaped character (like \n) in the replace area
-- Rework the keyboard bindings (now the underlined letter is the shortcut (Alt+letter)
-- User can now define its own file with pattern (format = 1 line for name, 1 line for regexp) (try to autoload file called regexp.txt)
-- Suggested reading
-- Add popup menu to choose font (with right-click)
-- Memorize location and file name to ease Loading/Saving
-- New option to change background in matches (useful to see 'invisible' characters such as space or tabs)
-- User can customize the defaults in a file called 'visual_regexp.ini'
-- A nice tutorial here.
-- Added Previous/Next button to navigate among the matches
A special thanks to Luciano Espirito Santo for bug report and a lots of ideas.

Bugfix: the line option when not properly handled when using replace.
New options to save the sample text (useful for small in place text manipulation).
New format (.tar.gz) to show that the program can be run directly.
New README file to explain how to use the program.
2.1 Make-regexp: construction of an optimized regexp from a list of words
2.0 New GUI.
Support for user predefined regexps.
1.2 Distribution as gzip-ed file to avoid conversion problems between DOS/UNIX.
Support for undo/redo.
Support for replace function after matching the sample.
Correction of a few typos in the help text.
1.1 Correction of a bug in handling non-reperting subexpressions.
1.0 Initial release.