Latest

Archive

Community news

C++

Communities and Content

Databases

Editorials

Emacs

General

HTML

Java

Notices

PHP

XML

Apache

C++

Database

General

HTML

Java

Javascript

Linux

Object oriented programming

Open source

Perl

PHP

Python

Ruby

SOAP

XML

Suggest a link

Advertise on zez

Contribute

Contact us

About zez


Regular Expressions explained



Utilities

There exists several utilities which uses regular expression. I'll leave a list of them with a short description:

grep

Grep searches named input files for lines containing a match to the given pattern. It can also be used to find files which contains a specific pattern, for instance:

grep -E "cow|vache" * >/dev/null && echo "Found a cow"


This is utility is rather common on Linux distributions, but if you don't have it you can grab a version on the GNU page

A small tip is to enable extended regular expressions with the options -E, if not a lot of the metacharacters explained in this article won't work.

sed

Sed is a stream editor. A stream editor is used to perform basic text transformations on an input stream.

This is utility is rather common on Linux distributions, but if you don't have it you can grab a version on the GNU page

gawk

Gawk is the GNU Project's implementation of the AWK programming language. It conforms to the definition of the language in the POSIX 1003.2 Command Language And Utilities Standard.

This is utility is rather common on Linux distributions, but if you don't have it you can grab a version on the GNU page

RegExplorer

RegExplorer is a visual regular expression explorer, it allows for writing regular expressions and visually see the matches, thus making regular expression much easier to write and maintain.
RegExplorer
You can grab a copy at the RegExplorer page.

Visual RegExp

This software will let you design your regexps by letting you type the expression and visualize its effect on a sample of your choice.
Visual RegExp
You can grab a copy at the Visual RegExp page.

Regexx

Regexx is a complete regular expressions C++ solution. It implements easy expression execution, global searching, replace with atom substitution, customized replaces, easy match and atom strings retrieving.

Grab a copy at it's homepage.


Regular expression related links:

Regular Expressions and NP-Completeness
Equivalence of Regular Expressions and Finite Automata
Perl Regular Expression Tutorial


<< Previous page | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | < 9 > | Printer-friendly page |

Comment List


Topic: Author:
Time:
another great regexp tool S Church 01.03.2005 16:16

There's a free-as-in-beer development environment for Windows called HTML-Kit that's just great for writing scripts and web code. The Find or Find / Replace functions have a check box for Regexps, with a "Find All" button to highlight every instance matched by a regexp. The only drawback is that it assumes /is (case insensitivity and multiline).

VisualREGEXP mentioned in the article says it has no required supporting files, that the standalone executable is all that's needed. However, most Windows machines don't have the TCL/TK component "wish," which the README file claims is necessary for operation. Wish might be available somewhere online as a precompiled binary without having to install all of TCL/TK, but I'm not motivated enough to google it at the moment.


Email match David Robarts 15.01.2005 22:45

Some valid email addresses will fail this expression (and some invalid addresses pass).

[a-z0-9_-]+(.[a-z0-9_-]+)*@[a-z0-9_-]+(.[a-z0-9_-]+)+

The underscore character is not allowed in the domain part of the email address and some additional characters are allowed in the username part.

This might be better:

[a-z0-9_-]+(.[a-z0-9_-+]+)*@[a-z0-9-]+(.[a-z0-9-]+)+


can't see the graphic x x 02.11.2001 01:59

I can't see the graphic towards the bottom to demonstrate the usage of < >




Forgot your password?

Register a new user

Results

Polls