* Thus wrote Floris ([EMAIL PROTECTED]):
> hi,
> I have this piece of code. but the problem is that he also links parts of
> words (like: credits) and i wnat only standalone words (like: edit)
> Does someone have i idea to correct this piece of code?
> 
> Floris
> 
> {
> $regex1 = ">[^<]*(";
> $regex2 = ")[^<]*<";
> preg_match_all("/".$regex1.$search_word.$regex2."/i", $string, $matches,

Use the word boundry character:

$regex1 = ">[^<]*\b(";
$regex2 = ")\b[^<]*<";


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to