Scripting > UNICOM Intelligence Function Library > Text functions > RegExFind
 
RegExFind
Returns the first substring matched by the regular expression in the string Val. Returns an empty string if a match was not found for the regular expression.
Syntax
RegexFind (Val, RegexExpression [, Start [, End [, IgnoreCase]]])
Parameters
Val
Type: Text
The text to be validated.
RegExExpression
Type: Text
The regular expression.
Start
Type: Long
Optional. The position to start the search in Val. The default value is 0, which means the search starts at the first Val character.
End
Type: Long
Optional. The position to end the search. The default value is 0, which means that whole string is searched.
IgnoreCase
Type: Boolean
Optional. The default value is False.
Remarks
ICU string types are not currently supported. For more information, see “Working With Unicode and ICU String Types”:
http://boost.sourceforge.net/libs/regex/doc/icu_strings.html
Example
The following mrScriptBasic example uses the RegExFind function to search the email address from the LogEntry:
LogEntry.RegexFind ("^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$")
See also
Text functions