regex help please

Klaus on-rev klaus at major.on-rev.com
Thu Feb 9 15:24:12 EST 2012


Hi friends,

in my current project I need to deal with VERY small XML files 
with maybe up to 20 entries.

So using the XML external seems to be a bit overkill.

Some time ago I found a little reg ex here on the list which I turned
into a function and will return me everything inside of a given XML tag:
...
<tag1>bla bla</tag1>
<tag2>more bla bla</tag2>
...

So with this text above in tText and "tag2" int tTag:

function mk_getXMLdata tText, tTag
   get matchText(tText,"(?s)<" & tTag & ">(.*?)</" & tTag & ">",tValue)
   return tValue
end mk_getXMLdata

will give : more bla bla
So far so good, I even almost understand the reg ex ;-)

Now I am looking for another little snippet to (over) write something in(to) 
a certain TAG, know what I mean?

If someone could supply a nifty "replacetext" snippet that would be great! :-)
Thanks in advance!


Best

Klaus

--
Klaus Major
http://www.major-k.de
klaus at major.on-rev.com





More information about the use-livecode mailing list