Skip to main content


REGEXFIND(regex, text [, flag ] [, NOCASE])

regexA standard Perl regular expression.
textThe text to parse.
flagOptional. Specifies the text to return. If omitted, REGEXFIND returns TRUE or FALSE as to whether the regex was found within the text. If 0, the portion of the text the regex was matched is returned. If >= 1, the text matched by the nth group in the regex is returned.
NOCASEOptional. Specifies a case insensitive search.
Return:REGEXFIND returns a single value.

The REGEXFIND function uses the regex to parse through the text and find matches. The regex must be a standard Perl regular expression. We use third-party libraries to support this, so for non-unicode text, see boost docs at Note that the version of Boost library may vary depending on your distro. For unicode text, see the ICU docs, the sections 'Regular Expression Metacharacters' and 'Regular Expression Operators' at and the links from there, in particular the section 'UnicodeSet patterns' at We use version 2.6 which should support all listed features.


namesRecord := RECORD
STRING20 surname;
STRING10 forename;
STRING10 userdate;
namesTbl := DATASET([ {'Halligan','Kevin','10/14/1998'},
{'MacPherson','Jimmy','03/14/2003'} ],
searchpattern := '^(.*)/(.*)/(.*)$';
search := '10/14/1998';

filtered := namesTbl(REGEXFIND('^(Mc|Mac)', surname));

OUTPUT(filtered); //1 record -- MacPherson

REGEXFIND(searchpattern, search, 0); //returns
REGEXFIND(searchpattern, search, 1); //returns '10'
REGEXFIND(searchpattern, search, 2); //returns '14'
REGEXFIND(searchpattern, search, 3); //returns '1998'