GetFirstRegexMatch

Top  Previous  Next

function GetFirstRegexMatch(sSource, sRegex) As String

 

Searches in sSource for the first occurrence of sRegex. sRegex is a Perl compatible Regular Expression.

 

GetFirstRegexMatch is case-insensitive. If sRegex is not found, GetFirstRegexMatch returns an empty string.

 

Parameters

 

sSource ... String expression sought.
sRegex ... Regular expression being searched.

 

Example:

Dim s, s2

 

= "this is number 13 or a text"

s2 = GetFirstRegexMatch(s, "number \d+")

' returns s2 = "number 13"




Translate document: