Regular Expressions

Regular expressions are a pattern matching language.  Using regular expressions, you can perform amazingly powerful and complicated transformations of text.  Regular expressions are rather too complex to fully explain here, so please consult one of these tutorials:

Introductory Guide to Regular Expressions

Pattern Matching and Regular Expressions

Or search the web for more information.

Common Problems

Special Characters

If your regular expression isn't working, or is doing something unexpected, you may be trying to use a special character:

\^$*+?.()|{}[]

If you want to use one of those characters as part of what you're matching, you need to put a backslash (\) in front of it.  So if you wanted to match "text.htm?pagewanted" you should write "text\.htm\?pagewanted".

Except for the backslash, none of those characters are special in the replacement part of the regular expression, so you don't have to put a backslash in front of them in the replacement part.