Reply to Regular expression - match string containing a but not a and b

Your name:

Reply:


Posted by gfrith on 02/06/07 13:10

Hi,

A quick regex question which I've worked around for the time being,
but would like an answer to if anyone can help.

I want to match on all strings which end _id, but not those ending
row_id.

Some sample strings:

row_id
parent_id
person_id
person

I'd like to match all but the 1st and last.

I've tried many variants, including

preg_match('/(row)\w{0}_id$/',$subject);
preg_match('/(row){0}_id$/',$subject);
preg_match('/(?!row)_id$/',$subject);

None work correctly. As I say I've worked around this issue as I have
very little time, but would like to know the proper solution.

Thanks in advance. Greg.

[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

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