matchChunk & matchText broken?
preid at reidit.co.uk
preid at reidit.co.uk
Fri Aug 13 04:31:45 EDT 2021
Either I'm doing something wrong or both matchChunk and matchText are broken.
For example using matchChunk:
local tStartPos, tEndPos
put empty into tStartPos
put empty into tEndPos
put matchChunk("hello world how are you", "\ ho[a-z]", tStartPos, tEndPos) into itMatches
put itMatches & "|" & tStartPos & "|" & tEndPos & "|"
The output is: true||| - in other words a match is found but the positions are not being returned in the variables tStart and tEnd
I get the same behaviour from matchText, ie it correctly finds or not the patterns I'm looking for but I don't get the positions (matchChunk) or text (matchText).
These seem to be fairly fundamental and frequently used functions that should just work. Which is why I'm assuming that I'm doing something wrong!
Please can anyone correct me (or confirm the fault)?
Thanks
Peter
--
Peter Reid
Loughborough, UK
More information about the use-livecode
mailing list