【发布时间】:2016-05-24 15:34:10
【问题描述】:
我有以下字符串:
ignoreword1,word1, ignoreword2
我想匹配不是ignoreword1 或ignoreword2 的任何单词
这是我目前所拥有的
(?s)^((?!ignoreword1).)*$
主要目标是使用正则表达式作为 postgresql 数据库的一部分,在删除“ignoreword1”、“ignoreword2”和逗号“,”后选择列与子字符串匹配的行
【问题讨论】:
-
匹配任何不是ignoreword1或ignoreword2的单词使用
\b(?!(?:ignoreword1|ignoreword1)\b)\w+,但也许,你的意思是匹配一个字符串,然后,尝试^(?!(?:ignoreword1|ignoreword1)$).* -
请将其作为答案发布!
标签: sql regex database postgresql match