You are here: Re: [PHP] regular expressions « PHP « IT news, forums, messages
Re: [PHP] regular expressions

Posted by Erwin Kerk on 11/10/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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация