HTML issue

Eric Chatonet eric.chatonet at sosmartsoftware.com
Thu Nov 17 15:52:05 EST 2005


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        eric.chatonet at sosmartsoftware.com/


More information about the use-livecode mailing list