alias striptags { return $regsubex($$1,/\[ $iif($prop == strict,style \40) .+?\]/gx,) }
I've added a .strict property to make it only remove [style] tags. If you suppress .strict it will remove all tags, including [b], [i], etc..
To see the difference try this example:
alias test {
var %tags = [b][i]l[style co:#040404;b;]i[style co:#080808;b;]k[style co:#0C0C0C;b;]e [style co:#141414;b;]t[style co:#181818;b;]h[style co:#1C1C1C;b;]i[style co:#202020;b;]s [style co:#282828;b;]o[style co:#2C2C2C;b;]n[style co:#303030;b;]e [style co:#383838;b;]l[style co:#3C3C3C;b;]a[style co:#404040;b;]l[style co:#444444;b;]a[style co:#484848;b;]l[style co:#4C4C4C;b;]a[style co:#505050;b;]l[style co:#545454;b;]a[style co:#585858;b;]l
echo -a Strict: $striptags(%tags).strict
echo -a Normal: $striptags(%tags)
}