Skip to content

Instantly share code, notes, and snippets.

@JoeGlines
Last active April 23, 2023 08:19
Show Gist options
  • Save JoeGlines/a1fa40920b35d773b5489f05d87b7af4 to your computer and use it in GitHub Desktop.
Save JoeGlines/a1fa40920b35d773b5489f05d87b7af4 to your computer and use it in GitHub Desktop.
;*******************************************************
; Want a clear path for learning AutoHotkey; Take a look at our AutoHotkey Udemy courses. They're structured in a way to make learning AHK EASY
; Right now you can get a coupon code here: https://the-Automator.com/Learn
;*******************************************************
Haystack =
(
hello [email protected] more text
worked and [email protected]
did too and [email protected]
this also works [email protected]
432 432 [email protected] 43432
)
;Send ^c ;uncomment to use in any program
;Haystack:=Clipboard ;uncomment to use in any program
Pos:=1 ;set starting position
loop, {
Pos_Found:=RegExMatch(Haystack,"i)(?:[\w_\.-]+)@(?:[\w\.-]+)\.(?:[a-z\.]{2,6})",mail,Pos)
Pos:=Pos_Found+StrLen(mail)+1 ;move location to new position + mail lenght+ 1
IfEqual,mail,,break ;Break loop if no mail found
mails.=mail "`n"
}
MsgBox % mails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment