regex help please
andre at andregarzia.com
Thu Feb 9 14:38:45 CST 2012
I used to work like that, doing little XML files with RegEx and matchText.
After working like that for a long time, I came to realize that there was
no advantage at all in my case. It was simpler to work with RevXML. The
problem with RegEx is all the little cases where it fails. I think you
should use RevXML, it might look overkill but it will cut your debug time a
On Thu, Feb 9, 2012 at 6:24 PM, Klaus on-rev <klaus at major.on-rev.com> wrote:
> 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
> a certain TAG, know what I mean?
> If someone could supply a nifty "replacetext" snippet that would be great!
> Thanks in advance!
> Klaus Major
> klaus at major.on-rev.com
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
http://www.andregarzia.com -- All We Do Is Code.
http://fon.nu -- minimalist url shortening service.
More information about the use-livecode