Code to Find a URL and not an email address

PHOTO EMBED

Mon Dec 05 2022 03:34:10 GMT+0000 (Coordinated Universal Time)

Saved by @savabeh191 #autohotkey #0

text=
(
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Lorem ipsum Joe@the-Automator.com 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
content_copyCOPY

https://www.the-automator.com/using-a-regular-expression-regex-to-find-a-url-and-not-an-email-address/