Код
FileRead, file, File1.txt ; Читаем файл File1.txt
; ------------------ 1 пример -------------------
RegExMatch(file, "the pattern(.*)would search", Match) ; Указываем первую строку, в моем случае это была строка "the pattern" и вторую "would search"
MsgBox, % Match1 ; Выводим результат в переменной "Match1"
; ------------------ 2 пример -------------------
found1 = the pattern ; задаем переменной "found1" значение первой строки "the pattern"
found2 = would search ; задаем переменной "found2" значение первой строки "would search"
RegExMatch(file, "\Q" found1 "\E(.*)\Q" found2 "\E", Result)
MsgBox, % Result1 ; Выводим результат в переменной "Result1"