What is the best/fastest way to extract strings of text?

Keith (Gulf Breeze Ortho Lab) keith at gulfbreezeortholab.com
Tue Aug 2 03:24:35 EDT 2011


Hello,

I am still playing with LiveCode and am now exploring chunks...

My question is as follows. Suppose I have a variable with a lot of text. Throughout the text I have various strings, separated by consistent tags, that I need to extract.

For example, the following text is in the variable myVar:

The boy <#B>went to the store<#E>. He enjoyed his day out.

The woman loves <#B>shopping at the mall<#E>. So do I.

The girl loves <#E>eating at the restaurant<#E>. So does he.

I am looking for the most efficient way to extract each of the strings of text between the <#B> and <#E> tags... I presume I will have to use a loop and the matchChunk function? I have experimented but am having a problem putting starting and ending positions into variables.

Is there a better way to accomplish the above?

Thanks!

- Boo


More information about the Use-livecode mailing list