Skip to content

Instantly share code, notes, and snippets.

@JoeGlines
Created May 28, 2021 21:24
Show Gist options
  • Save JoeGlines/cc40e4806e91242bb288590284d53bc0 to your computer and use it in GitHub Desktop.
Save JoeGlines/cc40e4806e91242bb288590284d53bc0 to your computer and use it in GitHub Desktop.
text=
(
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Lorem ipsum [email protected] dolor sit amet, (555)555.8957 the-Automator.com consectetuer adipiscing elit.
https://www.linkedin.com/in/joeglines/ @recruiting lorem ipsum
dolor sit http://github.com/maestrith/AHK-Studio elit.
dolor sit www.github.com/maestrith/AHK-Studio elit.
)
Pos:=1 ;set starting point
Loop, {
;Regex Pattern for URLs borrowed from https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url
Found_Pos:=RegExMatch(Text,"i)((http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?)",Obj,Pos)
Pos:=Found_Pos+(StrLen(obj)+1) ;Set next start position
URLs.=obj "`r" ;add to emails variable
If not OBJ ;If not found break Loop
Break
}
MsgBox % URLs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment