FINDREGEX

Syntax

FINDREGEX (string_expression, search_regex)

Description

Returns the starting position of a match for a regular expression within a string.

Arguments

string_expression The string to search.
search_regex A String Microsoft-formatted regular expression.

Returns

An Integer32 that contains the starting position of the first match for the regular expression found within the string.

If no match is found, returns 0.

Remarks

If search_regex is not found, FINDREGEX returns a 0.

For detailed information about using Regular Expressions, see the Microsoft .NET Regular Expression Language - Quick Reference.

Example

If MyEntity.Address contains the value "1750 Elm St Manchester NH 03104"

FINDREGEX(MyEntity.Address, "(^\d{5}$)|(^\d{5}-\d{4}$)")

Returns: The location of the Postal Code in the string.

Related Topics

Text Functions

FIND

ISREGEXEXACTMATCH

MATCHREGEX

REPLACEREGEX