Regular expressions are used in ColdFusion to parse text, to find patterns or substrings within a string, and to replace patterns or substrings within a string. Regular expressions can be made up of letters, numbers, punctuation characters, and other special characters and metacharacters.
Metacharacters are the special characters that perform functions within a regular expression. They can also be characters within the string for which you're searching, but they must be escaped to be considered a literal character.
There are four native ColdFusion functions that enable ColdFusion programmers to utilize the power of regular expressions to help solve complex search and parsing problems. There are two functions for finding patterns within string: REFind() and REFindNoCase(). In addition, there are two more that find and replace patterns within a string: REReplace() and REReplaceNoCase(). Each function enables you to do some very powerful things with your code.
As we proceed through this chapter, you'll learn more about the basic use and syntax of regular expressions, the metacharacters that we mentioned, and how to leverage regular expressions within your ColdFusion applications.