Hi Ken,
Thank you.
Seems that your solution would change the first color definition that
is already present in the html code.
May be I misunderstand :-)
In my case, first there are hundred of occurrences and second, they
have not any color tag yet.
Best Regards from Paris,
Eric Chatonet.
PS. It's time for me to dig in Regex...
Le 17 nov. 05 à 21:04, Ken Ray a écrit :
I want to change the colour of a string in some styled text.
As the string may be any string like "font", "size", etc. that appear
in html tags,
I use the following code that works but I'm not satisfied with it...
Any more elegant solution?
Yes, you can use regex:
put the htmlText of fld "Result" into tText
if matchChunk(tText,"(?s)<font.*?color=\"(.*?)\"",tStart,tEnd) then
put the uPatternColor of this stack into char tStart to tEnd of
tText
end if
set the htmlText of fld "Result" to tText
----------------------------------------------------------------
So Smart Software
Free plugins and tutorials on my website
----------------------------------------------------------------
Web site http://www.sosmartsoftware.com/
Email [EMAIL PROTECTED]/_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution