Regular Expressions

Top  Previous  Next

A regular expression (regex for short) is a special text string for describing a search pattern. You can think of regular expressions as wildcards on steroids. You are probably familiar with wildcard notations such as *.txt to find all text files in a file manager. The regex equivalent is .*\.txt. Regular expressions are extremely fast and versatile, however they are complicated and should only be attempted by advanced users.


Why are we using regular expressions rather than create some sort of simpler syntax? Well, the simple answer is that regular expressions are widely used. There is  nothing that has the power and speed of regular expressions that is a wisely adopted standard. Experienced administrators and script writers have long used regular expressions in Perl scripts on Linux platforms. For many, regular expressions are an old friend.


Because it is difficult to write and debug regular expressions, we recommend and use a product called RegexBuddy from JGsoft. You can get more information from their web site at It costs only $39.95 and well worth every penny. It allows you to build regular expressions graphically and then test them against real world blocks of text such as actual message headers and message bodies.