Reference > Expressions > Built-in Functions > Regular Expression Functions > FirstRegexMatch

FirstRegexMatch

Returns the substring of text that is the first match of /regex/.

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions for information about regular expressions.

Syntax

FirstRegexMatch(text, exp)

Enabled for

Search/Dashboard No
Business Rules Yes
Quick Actions Yes
Workflow Objects No
Reports No

Parameters

text The text in which to look for the regular expression.
exp The regular expression to look for in the text.

Return Value

Returns a subset of text that is the first match of the regular expression.  Returns null if there is no match.

Example

FirstRegexMatch("Hello there! This is a test, isn't it?", /there.*test/i)

The example above returns "there! This is a test".