Searches for the first match in the string.
A Match object is always returned by this method, so you should check the
Match.Success property to find if the pattern was found.
The next match could be found using Match.NextMatch.
Syntax: Match (String As String) As Match
Example:
Sub CapitalizeFirstLetterInSentence
Match1.New1
Regex1.New1("(?<=\.\s*|^)(\w)(\w*)") 'We are using two groups in
this pattern.
s = "this is a long string. the brown fox jumped over the fence.
regex are much simpler than they first seem."
Match1.Value = Regex1.Match(s)
Do While Match1.Success
s = StrRemove(s,Match1.Index,Match1.Length)
s = StrInsert(s,Match1.Index,StrToUpper(Match1.GetGroup(1))
& Match1.GetGroup(2))
Match1.Value = Match1.NextMatch 'Step to the next match.
Loop
Msgbox(s)
End Sub