Code: Select all
on mouseup
put empty into tStart; put empty into tEnd
get matchChunk("Hello", "e", tStart, tEnd)
answer tStart && tEnd
end mouseup
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Code: Select all
on mouseup
put empty into tStart; put empty into tEnd
get matchChunk("Hello", "e", tStart, tEnd)
answer tStart && tEnd
end mouseup
Code: Select all
on mouseUp
put "my socks are yellow" into rmSTRING
get matchChunk (rmSTRING, "k", xStart, xEnd)
answer xStart && xEnd
end mouseUp
Code: Select all
on mouseUp
--put "my socks are yellow" into rmSTRING
get matchChunk ("my socks are yellow", "k", xStart, xEnd)
answer xStart && xEnd
end mouseUp
Code: Select all
on mouseUp
put "my socks are yellow" into fld "fff"
get matchChunk (fld "fff", "k", xStart, xEnd)
answer xStart && xEnd
end mouseUp
Where do you remember this from as it has obviously been a "dead duck" for quite some time?From what I remember
Code: Select all
on mouseUp
--put "my socks are yellow" into rmSTRING
put matchChunk ("my socks are yellow", "k", xStart, xEnd)
--answer xStart && xEnd
end mouseUp
Code: Select all
on mouseUp
--put "my socks are yellow" into rmSTRING
get matchChunk ("my socks are yellow", "k", xStart, xEnd)
put xStart && xEnd
--answer xStart && xEnd
end mouseUp
The code below works in your example. But I am notoriously bad at regex.matchChunk(field "Title",myExpr,startMatch,endMatch)
Code: Select all
on mouseup
put empty into tStart; put empty into tEnd
get matchChunk("Hello", "([e])", tStart, tEnd)
answer tStart && tEnd
end mouseup
Code: Select all
on mouseUp
put empty into xStart; put empty into xEnd
get matchChunk ("my socks are yellow", "[(k)]", xStart, xEnd)
answer xStart && xEnd
end mouseUp
Code: Select all
on mouseUp
put empty into xStart; put empty into xEnd
get matchChunk ("my socks are yellow", "([k])", xStart, xEnd)
answer xStart && xEnd
end mouseUp
Code: Select all
on mouseup
put empty into tStart; put empty into tEnd
get matchChunk("Hello", "(e)", tStart, tEnd)
answer tStart && tEnd
end mouseup
Code: Select all
2,2
Code: Select all
on mouseup
get matchChunk("Hello", "(el).*(o)", tOne, tTwo, tThree, tFour)
answer tOne && tTwo && tThree && tFour
end mouseup
Code: Select all
2 3 5 5
But for the right sort of brackets and their order a program was lost."([k])"
suggests so. (I said I was guessing at regex) But I stay away from matchChunk but use charOffset instead.matchChunk(string, regularExpression [, positionVarsList])
Code: Select all
<Measure>
<MeasureType>08</MeasureType>
<Measurement>2137</Measurement>
<MeasureUnitCode>gr</MeasureUnitCode>
</Measure>
<Measure>
<MeasureType>01</MeasureType>
<Measurement>234.0</Measurement>
<MeasureUnitCode>mm</MeasureUnitCode>
</Measure>
Not sure that is true. You could certainly use "ordinary" LC with its offset functions, then find the end tag, and put it all together, but these certainly are not as compact as regex.only regex will allow me to do that.