Reply to Matching user inputed regexp

Your name:

Reply:


Posted by Orin on 07/04/07 08:40

Hello!

I'm using php and have a complicated task, so if someone can
understand it then please help me to solve it

The task is to make function, that will understand user-inputed regexp
and perfome some actions with inputed regexp.

For example:
'categories: ".*" -"foo"' means "all categories, but not 'foo'"
'categories: "foo[a-b]*" ".*bar"'
The regexp are not case-sensitive.

A '-' (dash) preceeding a categoryname means "do not select this
category".

Here is the function that is ok for ".*" but not for ".* -foo":

function cheaker ($string ,$patterns) {
$patterns_list = explode(" ", $patterns);
foreach($patterns_list as $cs)
$res = eregi($cs, $string, $regs);
return $regs[0];
}

[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

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