添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams
        $regex = '/\b'.$keyword.'\b/i'; // case insensitive match
        if (preg_match($regex, $linkedin_html) == 0)
            $this->_htmlValidationFailed++;
            continue;                

When I use this code.. i get error as unknown modifier 'v'..

pls let me know what is the problem and help me rectify.

Impossible to answer unless you show us what the value of $keyword is. I suspect, like David, it contains something the REGEX engine is attempting to parse as REGEX grammar. – Mitya Jul 9, 2012 at 11:44 we cant know what $keyword is beforehand.. it is some required information fetched from internet while running the code.. and each time it varies for different input. – Naren Karthik Jul 9, 2012 at 11:46 $keyword = preg_quote( $keyword, '/' ); $regex = '/\b'.$keyword.'\b/i'; // case insensitive match if (preg_match($regex, $linkedin_html) == 0) $this->_htmlValidationFailed++; continue; thanks berry.. but now it says..Warning: preg_match(): Compilation failed: regular expression is too large at offset #######. – Naren Karthik Jul 9, 2012 at 11:55 @NarenKarthik Well, I'm guessing that means that your regular expression is too large ;) If you're just testing for keywords, maybe a loop with strstr is a better fit than a regular expression? – Berry Langerak Jul 9, 2012 at 13:06