In our introductory article on Perl Regular Expressions, we showed how regular expressions can cut down the code that you have to write. This article discusses the format of regular expressions.
Regular expressions are used to match, change or translate strings against a pattern. In a traditional programming language, you will need to write a routine that scans your string and then do whatever you need to do. This approach is acceptable if the pattern is fairly simple. However, if your pattern is complicated, you will have to write a complicated routine to do your matching and comparing and translating.