代码改变世界

随笔分类 -  Oracle 正则表达式

正则表达式使用一例

2011-06-16 08:58 by Tracy., 359 阅读, 收藏, 编辑
摘要: 如何用正则表达式实现这样的需求 通过wm_concat()函数得到了这样的结果: '014,014,018,022,317,319,023,021' 如何继续排序和去重复呢? 期望结果:'014,018,021,022,023,317,319' 测试数据: select '014,014,018,022,317,319,023,021' from dual; wm_concat集合函数在plsq... 阅读全文

ITPUB上关于Oracle正则表达式的博文

2011-06-15 14:47 by Tracy., 662 阅读, 收藏, 编辑
摘要: Oracle 8 和Oracle 9i中缺乏灵活性的SQL 正则表达式最终在Oracle 10g中得到了解决。Oracle 数据库目前内建了符合POSIX 标准的正则表达式。 四个新的函数分别是:REGEXP_LIKE、REGEXP_INSTR、REGEXP_SUBSTR、和EGEXP_REPLACE。它们在用法上与 Oracle SQL 函数LIKE、INSTR、SUBSTR 和REPLACE 用法,但是它们使用POSIX 正则表达式代替了老的百分号(%)和通配符(_)字符。 POSIX 正则表达式由标准的元字符(metacharacters)所构成: '^' 表示字符串的开 阅读全文

oracle的正则表达式

2011-06-15 14:22 by Tracy., 674 阅读, 收藏, 编辑
摘要: 必须明白的是,oracle的正则表达式和其它的语言的并不是完全一样。 oracle支持以下标准的正则表达式: IEEE Portable Operating System Interface (POSIX) standard draft 1003.2/D11.2Unicode Regular Expression Guidelines of the Unicode ConsortiumExtends the matching capabilities for multilingual data beyond what is specified in the POSIX standard(即p. 阅读全文

如何用正则取美国人名.

2011-06-15 11:06 by Tracy., 807 阅读, 收藏, 编辑
摘要: 类似”Celmer,Kenneth Raymond”,"Cockrell Jr,Robert Charles”,"St John,Michael Raymond”需要取出颠倒然后用空格分隔取出第一个名字“Kenneth Celmer”,”Robert Cockrell”,”Michael St’。通过ITPUB高手指点,可用如下代码实现。SELECT name full_name, REGEXP_REPLACE(name,'\s*(\S+)[^,]*\,+\s*(\S+)[^,]*','\2 \1') name, userid usernam 阅读全文

Using Regular Expressions in Oracle Database

2011-06-14 16:53 by Tracy., 489 阅读, 收藏, 编辑
摘要: 4 Using Regular Expressions in Oracle DatabaseThis chapter introduces regular expression support for Oracle Database. This chapter covers the following topics:Using Regular Expressions with Oracle Database: OverviewRegular Expression Metacharacters in Oracle DatabaseUsing Regular Expressions in SQL 阅读全文
点击右上角即可分享
微信分享提示