Regex
By default, Lucee uses the older Oro Regex Engine, which is compatible with ACF.
Since 5.3.8.79, Lucee also supports using the more modern, compatible engine built into java.
You can switch engines using the following options in your Application.cfc / <cfapplication>
this.regex.engine = "java"; // default is "perl"
// or
this.useJavaAsRegexEngine = true;
To switch between Regex engines on the fly (<cfapplication>
only affects the current thread / request )
<!--- do perl regex stuff --->
<cfapplication action=“update” regex=“java”>
<!--- do modern java regex stuff --->
<cfapplication action=“update” regex=“perl”>
<!--- back to cperl regex stuff --->
Functions
- IsValid() Tests whether a value meets a validation or data type rule.
- REFind() Uses a regular expression (RE) to search a string for a pattern. The search is case sensitive.
- REFindNoCase() Uses a regular expression (RE) to search a string for a pattern, starting from a specified position. The search is case-insensitive.
- REMatch() Uses a regular expression (RE) to search a string for a pattern, starting from a specified position.
- REMatchNoCase() Uses a regular expression (RE) to search a string for a pattern, starting from a specified position.
- REReplace() Uses a regular expression (RE) to search a string for a string pattern and replace it with another. The search is case-sensitive.
- REReplaceNoCase() Uses a regular expression to search a string for a string pattern and replace it with another. The search is case-insensitive.
Methods
- string.reFind() Uses a regular expression (RE) to search a string for a pattern. The search is case sensitive.
- string.reFindNoCase() Uses a regular expression (RE) to search a string for a pattern, starting from a specified position. The search is case-insensitive.
- string.REMatch() Uses a regular expression (RE) to search a string for a pattern, starting from a specified position.
- string.REMatchNoCase() Uses a regular expression (RE) to search a string for a pattern, starting from a specified position.
- string.rEReplace() Uses a regular expression (RE) to search a string for a string pattern and replace it with another. The search is case-sensitive.
- string.rEReplaceNoCase() Uses a regular expression to search a string for a string pattern and replace it with another. The search is case-insensitive.