【发布时间】:2013-10-29 06:53:35
【问题描述】:
这真的开始疼了!
我正在尝试使用正则表达式条件在 Oracle 开发人员中编写查询
我的目标是找出所有姓氏中包含的字符通常不包含在姓名中(非字母、空格、连字符和单引号)
即 我需要找到
J00ls
McDonald "Macca"
Smithy (Smith)
找不到
Smith
Mckenzie-Smith
El Hassan
O'Dowd
我现在的查询是
select * from dm_name
WHERE regexp_like(last_name, '([^A-Za-z -])')
and batch_id = 'ATEST';
它排除了除单引号之外的所有预期内容。在放置单引号字符时,Oracvel SQL Develoepr 解析器将其视为文字。
我试过了:
\' -- but got a "missing right parenthesis" error
||chr(39)|| -- but the search returned nothing
'' -- negated the previous character in the matching group e.g. '([^A-Za-z -''])' made names with '-' return.
如果你能提供任何东西,我将不胜感激。
【问题讨论】: