Reply to Re: Regex help

Your name:

Reply:


Posted by AnrDaemon on 12/21/07 17:40

Greetings, Moi.
In reply to Your message dated Tuesday, December 18, 2007, 17:29:22,

> Hello,

> On 18 dйc, 05:34, Toby A Inkster <usenet200...@tobyinkster.co.uk>
> wrote:
>> Patrick Drouin wrote:
>> > $pattern="/((a+)b?(c+))/";
>>
>> $pattern="/(a+)b?(c+)/";

> If you try this, you will see that it spit out

> [0] => aaabccc
> [0] => aaa
> [0] => ccc

TH, it is

[0] => aaabccc
[1] => aaa
[2] => ccc

which is HIGHLY different.

> That's not what I'm looking for...

RTFM FTW.
In (0) it always return the whole matched [sub]string.
Just ignore the [0] entry if You do not want to deal with it.


--
Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru>

[Back to original 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

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