this will acomplish that
Code: Select all
line := "first second third fourth fifth"
RegExMatch(Line, "^(?:.*?\K\b\S+\b){2}", word1) ; gets second word
RegExMatch(Line, "^(?:.*?\K\b\S+\b){3}", word2) ; gets third word
MsgBox, % word := word1 " "word2