On 11/17/05 8:28 AM, "Eric Chatonet" <[EMAIL PROTECTED]>
wrote:

> Hi all,
> 
> 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

Enjoy!

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [EMAIL PROTECTED]

_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to