如何使用REGEXP_LIKE排除下面的字符串。
当'TEST'字符串的下一个字符是 - 或。或 @
时示例:
TEST@TEST.COM
XX@TEST-XX.COM
TEST.TEST@LION.NL
TEST@DSFFDS.BE
NO.EMAIL@TEST.COM
但包括:
TESTTOM@LION.BE
HI@TESTP.COM
答案 0 :(得分:1)
试
...
WHERE NOT REGEXP_LIKE(field,'TEST[-.@]')
答案 1 :(得分:1)
试试这个,
WITH t AS (
SELECT 'TEST@TEST.COM' COL1
FROM dual
UNION
SELECT 'XX@TEST-XX.COM'
FROM dual
UNION
SELECT 'TEST.TEST@LION.NL'
FROM dual
UNION
SELECT 'TEST@DSFFDS.BE'
FROM dual
UNION
SELECT 'NO.EMAIL@TEST.COM'
FROM dual
)
SELECT t.col1
FROM t
WHERE NOT REGEXP_LIKE(COL1,'TEST[-.@]')
;