if myRegExpr.Exec(Addresses) then begin
// Get the full match
fullMatch := myRegExpr.Match[0];
WriteLn('full match: ' + fullMatch);
//while myRegExpr.ExecNext do begin
matchingText := myRegExpr.Match[1];
WriteLn('matching text: ' + matchingText);
// Get the index of the capture group within the full match
index := Pos(matchingText, fullMatch);
// Insert the formatted text into the full match at the appropriate index
formattedText := '<b><font color="#00FF00">' + matchingText + '</font></b>';
Insert(formattedText, fullMatch, index);
// Replace only the matched text with the formatted text
formattedAddress := StringReplace(Addresses, matchingText, formattedText, [rfReplaceAll, rfIgnoreCase]);
end;