正则表达式检查一个没有带有连续数字的拖尾字的字符串

时间:2017-05-09 13:11:13

标签: php regex

我尝试在没有拖尾指定单词的情况下隐藏字符串。这个词最后可以包含一个数字[0-9] +。

test test [match]
test test_word [not match]
test test_word9 [not match]
test test_word132 [not match]

以下正则表达式仅适用于_word或_word1 ... _ word9

.*(?<!_word|_word[0-9])$

有什么建议吗?

0 个答案:

没有答案