Help with Grep issue
Posted: 22 Oct 2022, 19:35
Hi,
What is wrong with my grep? It should not msgbox "ABC Group"?
This is a line in the download.htm file
<div class="geodir-post-meta-container bsui sdel-298db276" ><div class="geodir_post_meta text-left d-block geodir-field-banniere"><span class="geodir_post_meta_icon geodir-i-select" style=""><i class="fas fa-flag fa-fw" aria-hidden="true"></i> <span class="geodir_post_meta_title gv-secondary" >Banner: </span></span>ABC Group</div></div>
What is wrong with my grep? It should not msgbox "ABC Group"?
This is a line in the download.htm file
<div class="geodir-post-meta-container bsui sdel-298db276" ><div class="geodir_post_meta text-left d-block geodir-field-banniere"><span class="geodir_post_meta_icon geodir-i-select" style=""><i class="fas fa-flag fa-fw" aria-hidden="true"></i> <span class="geodir_post_meta_title gv-secondary" >Banner: </span></span>ABC Group</div></div>
Code: Select all
numpad2::
FileRead, FileRead1, DOWNLOAD.HTM
g:=grep(fileread1, "sU)Banner: </span></span>(.*)</div></div>")
for i, v in g
{
result1 := v.1
msgbox, %result1%
}
return
grep(haystack, needle)
{
a:=[], match := "", pos := 1
while pos:=RegExMatch(haystack, needle, match, pos+StrLen(match))
a[A_Index]:= {"match": match, 1: match1}
Return a
}
return