Created
January 11, 2021 20:01
-
-
Save maxkleiner/86ffb832d10a7ee69d0d1a36f1d69a04 to your computer and use it in GitHub Desktop.
These e-mails were extracted with a RegEx as Regextractor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
procedure RegEX_ExtractDemo; | |
var regEx: TRegExpr; //or OleVariant if HISUtils; | |
InStr, ResStr: String; | |
begin | |
ResStr:=''; | |
InStr:= 'Please e-mail us at support@mycompany.com or to sales@mycompany.com'; | |
// Create a regular expression | |
regEx:= TRegExpr.create; //HISUtils.RegExpr; | |
// Set regular expression pattern that specifies an e-mail address | |
regEx.Expression:='\w+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,6}'; | |
// Execute search | |
if regEx.Exec(InStr) then Repeat | |
ResStr:= ResStr + regEx.Match[0] + '; '; | |
Until not regEx.ExecNext; | |
//Log.Message('These e-mails were extracted: '+ResStr); | |
writeln('These e-mails were extracted: '+ResStr); | |
// Posts the following to the log: | |
//'These e-mails were extracted: support@mycompany.com; sales@mycompany.com;' | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment