Hi Guys.
Let’s say I have a string that is:
[code]
<span style=”font-family:Arial; font-size=10px; color:black”>This is the text</span>
And I want to strip out the “font-family:Arial;” part. In other words, remove any font formatting ONLY.
The problem is it could say “Helvetica” or it could say “Arial, sans-serif”, etc.
I know I could probably find the position of font-family and then the next semicolon, but is there a way using preg-replace or something that I could say: from “font-family” to any number of characters to a semicolon? I would need this to be done with the ENTIRE string of text inputted (I am using a YUI simpleeditor and want to strip out the font-formatting.)
My regular expression writing sux.
Much appreciated.