Page 1 of 1

matching regular expressions with string

Posted: Tue Dec 18, 2007 3:28 am
by crystal ship
I have used
preg_match("/$target/i", $file);
which returns many unwanted files
such as
if i am searching for file name test1.php it also returns test2.php.
so I tried to use preg_match_all like
preg_match_all("/$target/i", $file);
which returns nothing

What is wrong in this? In need of suggestions.

Thanks

Posted: Tue Dec 18, 2007 7:42 am
by feyd
impossible to answer without seeing the pattern and data you are pushing against it, and a better idea of what you want out of it.

Posted: Wed Dec 19, 2007 2:30 am
by crystal ship
Thank You
But I have solved the problem by using strcmp()