Page 1 of 1

MatchChunk is true but positionVarsList is empty

Posted: Mon Feb 10, 2020 5:47 pm
by dntknwjck
Hello
Another day of frustration the trying to follow the Dictionary and not getting the expected results.
I have the following code in a mouseUp event and get the expected results with matchText, but matchChunk returns true with the positionVariable empty.
However offset using the variable from matchText does give me the position.
Any help is appreciated

Code: Select all

on mouseUp pButtonNumber
   local tStr, regX
   put "J<somtthing>Jan 31, 2020</span></td><td class=" into tStr
   put ">(Dec|Nov|Oct|Sep|Feb|Ma[ry]|A[up][gr]|J[au][nl])\s([0123]\d),\s(\d{4})" into regX
   get matchChunk(tStr, regX ,t2 )
   if matchText(tStr, regX ,t1 ) then
      wait 0
   end if
   if matchChunk(tStr, regX ,t2 ) then
      wait 0
   end if
end mouseUp

Re: MatchChunk is true but positionVarsList is empty

Posted: Mon Feb 10, 2020 6:04 pm
by Thierry
Hi,

Please, try this...

Code: Select all

 
   local inputText, rex, catchedText, t1, t2

   put "J<something>Jan 31, 2020</span></td><td class=" into inputText
   put ">(Dec|Nov|Oct|Sep|Feb|Ma[ry]|A[up][gr]|J[au][nl])\s([0123]\d),\s(\d{4})" into rex
   
   if matchChunk(inputText, rex ,t1, t2 ) then
   	put  "Found: " & char t1 to t2 of inputText
   else
	put "No match!"
   end if

   if matchText(inputText, rex , catchedText ) then
	put "Found: " & catchedText
   end if
Regards,

Thierry

Re: MatchChunk is true but positionVarsList is empty

Posted: Tue Feb 11, 2020 1:33 pm
by dntknwjck
Thierry,
Thanks for the example I see the mistake I made.

Sure would be nice if the dictionary had examples like this.