2014-09-18 20:26 GMT+02:00 Peter Haworth <p...@lcsql.com>: > Like that better than mine - good use of htmltext and regex!
> Pete Thanks Peter, and for those having real headacke with regex, you can write the function this way: function getHtmlColors L if offset( "<p bgcolor=", L) < 1 then return "z" return char 12 to 18 of L -- the 6 hexa chars end getHtmlColors But I personaly find it extremely ugly :) Regards, Thierry > On Thu, Sep 18, 2014 at 11:01 AM, Thierry Douez <th.do...@gmail.com> wrote: > >> Another one with some regex flavor >> >> on mouseUp >> local t >> put the htmltext of fld 1 into t >> sort lines of t by getHtmlColors( each) >> set the htmltext of fld 1 to t >> end mouseUp >> >> function getHtmlColors L >> if matchText( L, "<p bgcolor=.#([0-9A-F]{6}).>", v) then return v >> return "z" >> end getHtmlColors >> >> Thierry ------------------------------------------------ Thierry Douez - http://sunny-tdz.com Maker of sunnYperl - sunnYmidi - sunnYmage _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode