i spent an entire day learning RegEx, i came to the conclusion that its best to use:
Code: Select all
StringReplace, link, result1, \,, all
updated script v1: (uses StringReplace to replace the backslashes) (simple/easy to understand)
Code: Select all
f1::
FileRead, output, curl2.txt
RegExMatch(output, "links"": \[\s*""(.*?)""\s*\]", result)
StringReplace, link, result1, \,, all
MsgBox, % link
return
updated script v2: (uses an expression with 5 capture groups, then combines them together in msgbox) (more complex/more concise)
Code: Select all
f2::
FileRead output, curl2.txt
RegExMatch(output, "(https:).(.).(.{16}).(..).(.{3})", x)
MsgBox, % x1 "" x2 "" x3 "" x4 "" x5
Return
thank you!