regular expressions
| From: | pete M | Date: | Thu, 14 Apr 2005 12:50:09 +0000 |
| Subject: | regular expressions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-213071@lists.php.net to get a copy of this message | ||
I've been messing about with this for a while to no avail.. so help would be appreciates
I'm new to regular expressions and tried this with preg_replace, now I'm using eregi_replace !
here's the text
$txt = '<span style="font-size: 10pt; font-family: "Times New Roman";">It<br />
blahh blahhh blahhh of<br />
</span>';
what I want to do it take the font-size and font-family attributes "out" so
style="font-size: 10pt; font-family: "Times New Roman";"
beomes
style=" "
and the php
$pattern = 'font-size:*\;';
$txt = eregi_replace($replace,'',$txt);
$pattern = 'font-family:*\;';
$txt = eregi_replace($replace,'',$txt);
What I'm trying to do is match the font-size: and replace everything up to the ; with '' ie nothing
dont work
Feel I'm so close ;-(
tia
Pete