You are here: Re: regular expression problem (preg_replace) « PHP Programming Language « IT news, forums, messages
Re: regular expression problem (preg_replace)

Posted by Rik on 01/03/07 16:27

monomaniac21 wrote:
> Rik wrote:
>> Rik wrote:
>>> preg_replace('/i($|i)/si','$1',$string);
>>
>> No need for the /s modifier offcourse...
>> --
>> Rik Wasmus
>
> hi rik that works great for instances of a single i at the end of the
> string (last character) but i also need it to strip out any i's that
> occur next to other i's so for example:
>
> 230ii := 230, 230iiiiii := 230,
> just as 230i := 230
>

The last one should work:
preg_replace('/i+(\b)/i','$1',$string);
--
Rik Wasmus

 

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

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