RegExp Guru

I’m utilizing CMS content within Flash. The CMS has been trimmed down to allow very low level formatting bold, underline, italic.

I need to keep the formatting within the content for printing purposes in coordination with device fonts - so everything is good there.

However, for custom embedded fonts, I’m having to parse/replace the formatting. I’m not that great with RegExp, so looking for some help. I can easily set up RegExp for each of the potential formatting tags, but know there has to be a more efficient way - maybe not without possible bugs, not sure.

Tags needing replaced:


<span style="font-weight: bold;">

<span style="font-style: italic;">

<span style="text-decoration: underline;">



<span style="font-weight: bold; font-style: italic;">

<span style="font-style: italic; font-weight: bold;">

<span style="text-decoration: underline; font-weight: bold;">

the problem is, styling may appear within any order:


<span style="text-decoration: underline; font-weight: bold; font-style: italic;">
<span style="font-weight: bold;  text-decoration: underline; font-style: italic;">
<span style=" font-style: italic; text-decoration: underline; font-weight: bold;">

Basically, I need to parse and replace each of these options with the appropriate custom CSS class I’ve set up.

<span class=“uib”>

any help is much appreciated!