MATCHREGEX
Syntax
MATCHREGEX (string_to_search, search_regex)
Description
In string_to_search, finds the first occurrence of the search_regex.
Arguments
string_to_search | The string to search. |
search_regex | A Microsoft-formatted regular expression. |
Returns
The first occurrence of the search_regex within the string_to_search.
Remarks
For detailed information about using Regular Expressions, see the Microsoft .NET Regular Expression Language - Quick Reference.
If a match for search_regex is not found, MATCHREGEX returns the empty string.
MATCHREGEX only finds the first occurrence of the match within the string_to_search. Subsequent occurrences are ignored.
Example
If MyEntity.Address contains the value "1750 Elm St Manchester NH 03104 3 Kilton Rd Bedford NH 03110"
MATCHREGEX(account.address, "(^\d{5}$)|(^\d{5}-\d{4}$)")
Returns: The first Postal Code (03104) in the string.