You are here: Re: [PHP] [DONE] Substr by words « PHP « IT news, forums, messages
Re: [PHP] [DONE] Substr by words

Posted by Marcus Bointon on 10/31/05 12:18

On 31 Oct 2005, at 06:27, Richard Lynch wrote:

> There's a certain point where the Regex expression reaches a level of
> complexity that I'm just not willing to accept in my code and call it
> "maintainable"
>
> / */ is fine, of course.
>
> But there's lots of times when I know there must be a one-line regex
> to replace 10 lines of code, but I don't WANT to use it because I'll
> stumble over that one-line Regex every time I have to change it.

I quite agree that many regexes are 'write only', but I don't think
that that means that using substr and friends is necessarily any
clearer. I sometimes find that a nested mass of string functions is
even more confusing - at least a regex has a fixed grammar. I've just
written a load of stuff that uses preg_replace_callback that I'm
quite pleased with.

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
marcus@synchromedia.co.uk | http://www.synchromedia.co.uk

 

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

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