Skip to content

Instantly share code, notes, and snippets.

@JoeGlines
Created May 30, 2021 21:02
Show Gist options
  • Save JoeGlines/ba4302b98d69265ee57939154fa91bfd to your computer and use it in GitHub Desktop.
Save JoeGlines/ba4302b98d69265ee57939154fa91bfd 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
;*******************************************************
#SingleInstance,Force
; http://the-automator.com/RegEx_Book
str =
(
Process created at [ PID: 1872 | TID: 1596 ]
Process created at [ PID: 4180 | TID: 7776 ]
Process created at [ PID: 6860 | TID: 1508 ]
)
Pos:=1 ;set starting point
loop, {
Found_Pos:=RegExMatch(str,"O)PID:\s+(\d{3,4})",Obj,Pos) ;Store where found and set obj as content
Pos:=Found_Pos+StrLen(obj)+1 ;set next Position to start search
if not obj ;if not found stop looping
break ;didn't find so break loop
PID.=obj.1 "`n" ;add found values to PID variable to display later
}
MsgBox % PID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment