RegularExpressionTips

From LeakonWiki

Jump to: navigation, search

Regular Expression Tips

正则表达式的一些技巧

Exclude some words

排除关键字 排除字符串 不包含关键字 不包含字符串

目标:当字符串中不包含 google 和 leakon 的时候,匹配字符串

\b((?!google|leakon)\w)+\b

下面是测试

hello_world // match
hello_leakon // not match
hello_google // not match
Personal tools