regex help please
Andre Garzia
andre at andregarzia.com
Thu Feb 9 16:25:07 EST 2012
On Thu, Feb 9, 2012 at 7:10 PM, Klaus on-rev <klaus at major.on-rev.com> wrote:
> Hi Andre,
>
> Am 09.02.2012 um 22:05 schrieb Andre Garzia:
>
> > Klaus,
> >
> > Since you have control, then instead of RegEx, you can go like
> >
> > <mynode>
> > nodecontent
> > </mynode>
> >
> > All in different lines, then, you can just use lineOffset to find the
> start
> > node and the end node and copy or replace the data between those lines.
> > It is easier than RegEx.
>
> well, that's what I want to find out by myself, but can't without the
> appropriate reg ex ;-)
>
Klaus,
If you create the XML like I placed above you can replace content with
something like:
command replaceXMLNodeContent pNode, @pXML, pNewContent
put "<" & pNode & ">" into tStartNode
put "</" & pNode & ">" into tEndNode
put lineOffset(tStartNode, pXML) into tStartLine
put lineOffset(tEndNode, pXML, tStartLine) into tEndLine
put line tStartLine to tEndLine of pXML into tNodeContent
replace (tStartNode & cr & tNodeContent & cr & tEndNode) with (tStartNode
& cr & pNewContent & cr & tEndNode) in pXML
end replaceXMLNodeContent
>
>
> Best
>
> Klaus
>
> --
> Klaus Major
> http://www.major-k.de
> 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://lists.runrev.com/mailman/listinfo/use-livecode
>
--
http://www.andregarzia.com -- All We Do Is Code.
http://fon.nu -- minimalist url shortening service.
More information about the use-livecode
mailing list