regex help please

Ken Corey ken at kencorey.com
Thu Feb 9 16:15:54 EST 2012


On 09/02/2012 21:00, Klaus on-rev wrote:
>> get matchText(tText,"(?s)<"&  tTag&  ">(.*?)</"&  tTag&  ">",tValue)
>> replace "<"&  tTag&  ">"&  tValue</"&  tTag&  ">" with
>>   "<"&  tTag&  ">"&  tNewValue</"&  tTag&  ">"
>>   in tText
>
> well, I did not want to pass the text that I want to overwrite in the XML,
> which I do not now in that moment!
> But this is neccesary in Mark's and "zalgo/tony the coming pony"s (????? :-D ) scripts.
>
> I only want to pass the XML text, the tagname and the NEW text to be place inside of these tags.
> Any other hints?

You might take a look at the code again.

In both cases you hand in the whole XML text, the tag you want to 
replace, and the value you want to stuff into it.

The matchText function gets the current value in that tag.
Mark's replace above (or my replaceText) replace that, and return the 
result.

-Ken




More information about the use-livecode mailing list