Regex (matchChunk) help...

Mike Bonner bonnmike at
Fri Jun 15 13:21:05 EDT 2018

Try this..

on mouseup
   local tCharOffset
   --set the text of field 1 to the text of field 1
   put the text of field 1 into tText
   put "beginning" into tstartword -- string begin
   put "ending" into tEndword -- string end
   put 1 into tCounter -- tracks current word
   repeat for each trueword tWord in tText
      switch tWord
         case tStartword
            put tCounter into tPair
         case tEndword
            if tPair is not empty then
               put tPair & comma & tCounter & cr after tPairs
            end if
      end switch
      add 1 to tcounter
   end repeat
   delete the last char of tPairs
   repeat for each line tLine in tPairs
      set the textcolor of trueword (item 1 of tLine) to (item 2 of tLine)
of field 1 to "blue"
   end repeat
end mouseup

On Fri, Jun 15, 2018 at 11:03 AM Glen Bojsza via use-livecode <
use-livecode at> wrote:

> Mike, I believe that you are correct in understanding what I am trying to
> extract.
> I will need a bit more time to work through your solution.
> regards,
> Glen
> _______________________________________________
> use-livecode mailing list
> use-livecode at
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:

More information about the Use-livecode mailing list