Regular Expression Matching is the process of looking for text inside of other text, and optionally replacing it.Regular Expression Matching (RegEX) is one of the most frequently required techniques in scripting and programming. Regular Expression Matching is the process of looking for text inside of other text, and optionally replacing it. It is a more powerful alternative to using functions like Replace(), because it lets you describe a pattern that you are looking for, instead of doing a precise match. This makes RegEX extremely useful in Web development for tasks like automatically hyper-linking URLs, or pulling email addresses off of Webpages. But RegEX will also be of unlimited use to the InfoChannel WinScript developer.
Much of this baby-step tutorial will be dedicated to the variance between the WSH/ASP implementation of RegEX, and the way the rest of the world uses it.Using RegEX to do a search and replace across an entire document is sometimes called Global Replace (or GREP). There are special programs dedicated to doing regular expression matching, but RegEX is also commonly included natively in programming languages. It is a powerful technique with confusing syntax and implementations that vary from language to language. The particular RegEX implementation is sometimes called the RegEX engine. RegEX in the Windows Scripting Host (WSH) uses a Regular Expression "Object". While in some ways this is powerful, it mostly just adds a layer of obfuscation in using an otherwise straight forward technique. Much of this baby-step tutorial will be dedicated to the variance between the WSH/ASP implementation of RegEX, and the way the rest of the world uses it. |