i need a reg exp (to do a preg_replace) to find all <font> tags with a style="..." attribute…
the problem is that i need to match ONLY the <font> with a style attribute AND a value of
"height: 0;overflow: hidden;width: 0; position: absolute;"...
another problem, the style attribute may be in different positions;
ex.
<font color="white" style="height: 0;overflow: hidden;width: 0; position: absolute; font-family:courier; font-size:10px" >
or
<font style="height: 0;overflow: hidden;width: 0; position: absolute; font-family:tahoma; font-size:14px" color="red" >
EDIT: solved it with:
#</?font [^>]*\bheight: 0;overflow: hidden;width: 0; position: absolute;[^>]* >(.+</font[^>]*>|)#is
(find the tag with that style and everything it contains)
that reg exp in a preg_replace() seems to work !!
If you are sure that your HTML is nice enough to be accesible by Regex (i.e. no comments, nothing malformed, the style css does not contain comments, … ) and want to only match the opening tag (nesting is a no-no with regex), you can try
This regex matches every font-tag with a style attribute, and contains the value of this attribute in its only capturing group.
Edit: Maybe I misunderstood the question. If you need the style attribute to be the value you specified, use