I'm having a bit of trouble getting RegexMatch to extract some html values from a file (or from ClipboardGet_HTML from SKAN). It works when using inline variables but not from a file. Se example:
Code: Select all
txt =
(
<td>
111
</td>
<td>
222
</td>
)
; Create a file with the same text and read the data to a new string txt2
FileDelete, html.txt
FileAppend, %txt%, html.txt
FileRead, txt2, html.txt
msgbox Test 1: %txt%
; Extract text from the inline defined variable
n := 0
While n := RegexMatch(txt, "<td>(.*?)</td>", m, n+1) {
msgbox % m1 ; <---- Got two results: 111 and 222
}
msgbox Test 2: %txt2%
; Extract text from the file data
n := 0
While n := RegexMatch(txt2, "<td>(.*?)</td>", m, n+1) {
msgbox % m1 ; <---- Should get 111 and 222, but got no results at all
}
msgbox % strlen(txt) " " strlen(txt2) ; <--- Texsize differs, but the texts looks the same!
Thanks for any help...