A subscriber of my YouTube channel had an issue with using RegExMatch. I decided it was better to walk through the process in a video than to just provide the code. 🙂 As mentioned in the video I highly recommend Jack Dunning’s Regular Expressions AutoHotkey book.
Video demonstrating the RegExMatch example with AutoHotkey
Here is the RegExMatch example with AutoHotkey code
#SingleInstance,Force ; https://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