开发者

need help creating a non matching regex pattern

i'm trying to create a regex pattern that returns true if a certain word is not found. Ive tried using [^word] but that doesn't match up against a word just the individu开发者_运维问答al characters as they appear.

I need preg_match(using php) to return true cause there are other words that I to match and return true.


if you are looking for a string within a string (no pattern needed) then use strstr() or stristr()


if (!preg_match("/word/", $string)) { // <-- true, if not match
    // code here
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜