Loop, 5
{
RegExMatch( show, "s)<TD>(1)`r.<TD>[[color=red]A_Index[/color]]`r.<TD>(\d+)`r.<TD>(\d+)`r.<TD>(\d\.\d+)`r.<TD>(\d+/\d+)", m)
MsgBox, %m1% %m2% %m3% %m4% %m5% %m6%
}
DO...A_Index...work in RegExMatch( ) ?
#1
Posted 21 November 2011 - 07:29 AM
#2
Guests
Posted 21 November 2011 - 07:59 AM
Loop, 5
{
RegExMatch( show, "s)<TD>(1)`r.<TD>[" A_Index "]`r.<TD>(\d+)`r.<TD>(\d+)`r.<TD>(\d\.\d+)`r.<TD>(\d+/\d+)", m)
MsgBox, %m1% %m2% %m3% %m4% %m5% %m6%
}
#3
Posted 21 November 2011 - 09:13 AM
A_Index is a variable, so to use it in a string " " you must close the string.
txt1 := "content" txt2 := "txt3" txt3 := 1234 txt4 := "this is the " txt1 " of the var txt3 : " %txt2% "with reference" msgbox % txt4
#4
Posted 21 November 2011 - 09:43 AM
thanks for helping....but this
has to change to[" A_Index "]
....now its running(" A_Index ")
#5
Posted 21 November 2011 - 02:32 PM
@ Guest, CodeKiller.....
thanks for helping....but thishas to change to[" A_Index "]
....now its running(" A_Index ")
The [ ] are special chars ([a-z], [0-9] for example), you must escape them before use :
"\[" A_Index " \]"
#6
Posted 22 November 2011 - 03:34 AM
i get this"\[" A_Index " \]"
or this code do not work in AHK Basic---------------------------
data.ahk
---------------------------
Error at line 14.
Line Text: \["
Error: The leftmost character above is illegal in an expression.
The script was not reloaded; the old version will remain in effect.
---------------------------
OK
---------------------------
#7
Posted 22 November 2011 - 08:28 AM
data=mytest [12test]endoftest
loop 30
{
if regexmatch(data,"\[" A_Index "(t...)" "\]",result)
msgbox loopcount=%A_Index% result=%result1%
}
exitapp
#8
Posted 23 November 2011 - 03:03 AM
what do i put in the (red )....
if regexmatch(data,"\[" A_Index "(t...)" "\]",result)
i need the second variable indexed...
RegExMatch( show, "s)<TD>(1)`r.<TD>(" A_Index ")`r.<TD>(\d+)`r.<TD>(\d+)`r.<TD>(\d\.\d+)`r.<TD>(\d+/\d+)", m) ;working code...
#9
Posted 23 November 2011 - 09:08 AM
I am confused about the use of TD>(" A_Index ")`r.< while in the old it was
>[" A_Index "]`r.How does it look in the real code?
#10
Posted 24 November 2011 - 04:31 AM
i have the code working in AHK BASIC with this....
RegExMatch( show, "s)<TD>(1)<\/TD>`r.<TD>(" A_Index ")<\/TD>`r.<TD>(\d+)<\/TD>`r.<TD>(\d+)<\/TD>`r.<TD>(\d\.\d+)<\/TD>`r.<TD>(\d+/\d+)<\/TD>", h1d)This is a part of the (Haystack)Html....<COLGROUP>
<COL width=20>
<COL style="FONT-WEIGHT: bold" width=20>
<COL width=51>
<COL width=51>
<COL width=31>
<COL class=limit width=auto></COLGROUP>
<TBODY>
<TR data-id="93010" data-type="Game">
<TD>1</TD>
<TD>1</TD>
<TD>23</TD>
<TD>21</TD>
<TD>44.5</TD>
<TD>77/35</TD></TR>
<TR data-id="923010" data-type="Game">
<TD>1</TD>
<TD>2</TD>
<TD>67</TD>
<TD>32</TD>
<TD>22.6</TD>
<TD>88/12</TD></TR>
<TR data-id="94110" data-type="Game">
<TD>1</TD>
<TD>3</TD>
<TD>3</TD>
<TD>4</TD>
<TD>74.7</TD>
<TD>96/3</TD></TR>
<TR data-id="963010" data-type="Game"
#11
Posted 24 November 2011 - 08:32 AM
So the example i gave is not relevant to your problem anyway you solved it
#12
Gogo
Posted 24 November 2011 - 11:17 AM
Data =
(
<COLGROUP>
<COL width=20>
<COL style="FONT-WEIGHT: bold" width=20>
<COL width=51>
<COL width=51>
<COL width=31>
<COL class=limit width=auto></COLGROUP>
<TBODY>
<TR data-id="93010" data-type="Game">
<TD>1</TD>
<TD>1</TD>
<TD>23</TD>
<TD>21</TD>
<TD>44.5</TD>
<TD>77/35</TD></TR>
<TR data-id="923010" data-type="Game">
<TD>1</TD>
<TD>2</TD>
<TD>67</TD>
<TD>32</TD>
<TD>22.6</TD>
<TD>88/12</TD></TR>
<TR data-id="94110" data-type="Game">
<TD>1</TD>
<TD>3</TD>
<TD>3</TD>
<TD>4</TD>
<TD>74.7</TD>
<TD>96/3</TD></TR>
<TR data-id="963010" data-type="Game">
)
Str:= RegExReplace(Data, "</TD>[^<]+<TD>", " ") ; put a separator (space) between numbers
While RegExMatch(Str, "<TD>1 " A_Index " ([^<]+)", match)
{
MsgBox % A_index " --> " match1
}




