我的数据库中有一组具有 VARCHAR2 列值的行,如下所示:tac903.2、tac903.24、tac903.2a、tac903.2b
如果搜索表达式中的最后一个字符是数字,我想创建一个不匹配的正则表达式。因此,当我搜索“tac903.2”时,我只想匹配:tac903.2、tac903.2a 和 tac903.2b。这应该很简单,但我没有从我的正则表达式中得到想要的行为:
REGEXP_LIKE(col, 'tac903.2[a-z]?'); //This is matching the tac903.24 record.
REGEXP_LIKE(col, 'tac903.2[^0-9]?'); //This also is matching the tac903.24 record.
我是正则表达式的初学者,但根据我的研究,似乎上面应该实现我正在寻找的行为。有人能告诉我他们有什么问题吗?