Posted by Erwin Kerk on 10/15/69 11:13
pete M wrote:
> 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
>
Try this:
$pattern = 'font\-size:.*?\;';
Erwin Kerk
[Back to original message]
|