首页 > 解决方案 > 查找所有非常规的单引号

问题描述

我想从具有非常规撇号字符的列(姓氏)中获取所有记录。

即,,,U+2019U+2018还有U+201B什么?)

标签: sqloracle

解决方案


您可以使用正则表达式类来过滤这样的行:

select * from table where regexp_like(last_name, '[‘’`´‘’‛′‵]')

或者如果您不想直接在字符串中使用 unicode 字符:

select * from table where regexp_like(last_name, '[' || unistr('\2018\2019\201B`\00B4\2032\2035') || ']')

在 unicode 中可以找到更多非常规的单引号:https ://en.wikipedia.org/wiki/General_Punctuation

请注意一些https://en.wikipedia.org/wiki/Combining_Diacritical_Marks,因为它们可以与空格组合以使其看起来像引号。


推荐阅读