请问oracle正则表达式只是单纯的匹配汉字应该怎么写啊?比如大家好"和"大家好!"和"大家好!123"和"大家好abc"结果就只要第一个,后面的不显示,这样的正则表达式应该怎么写啊?或者单纯的sql能够实现也可以
------解决方案--------------------
--判斷全為雙字節就可以了
with t(col) as(
select '大家好' from dual
union all select '大家好!' from dual
)
select col from t where length(col)*2=lengthb(col);
------解决方案--------------------
with t(col) as(
select '大家好' from dual
union all select '大家好!' from dual
union all select '大家好‘' from dual
)
select col from t where length(col)*2=lengthb(col)
and regexp_like(col,'^[^[:punct:]]*$');
/*
COL
--------
大家好
*/