Oracle10g正则表达式

本文介绍了Oracle 10g中引入的正则表达式功能,包括常用的正则表达式操作符如regexp_like、regexp_instr等,并详细解释了各种符号的意义及用法,例如匹配任意字符、指定位置字符等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Regular expressions in Oracle
With 10g, regular expressions are finally available in SQL. That is, they were already supported through the owa_pattern package.
The new operators and functions are regexp_like, regexp_instr, regexp_substr and regexp_replace
symbolMatches
.Any character except newline
^Start of a line
$End of a line
*0, 1, or more of the preceding element. The preceding element can be grouped with ()
{n}Exactly n repetitions of the preceding element. The preceding element can be grouped with ()
{n,}Matches n or more repetitions of the preceding element. The preceding element can be grouped with ()
{m,n}Matches between m and n repetitions of the preceding element. The preceding element can be grouped with ()
[abc]Character list, matches a, b OR c.
[g-l]g, h, i, j, k, OR l
|groups alternatives

Character classes

The following character classes are suppored:
  • [[:alnum:]]
    Alphanumeric characters
  • [[:alpha:]]
    Alphabetic characters
  • [[:blank:]]
    blank space characters
  • [[:cntrl:]]
    Control characters
  • [[:digit:]]
    0 through 9, or [0-9]
  • [[:graph:]]
    [[:punct:]] + [[:upper:]] + [[:lower:]] + [[:digit:]]
  • [[:lower:]]
    lowercase alphabetic characters
  • [[:print:]]
    Printable characters
  • [[:punct:]]
    punctuation characters
  • [[:space:]]
    Non-printing space characters
  • [[:upper:]]
    Uppercase alphabetic characters
  • [[:xdigit:]]
    hexadecimal characters
Character classes can be negated: [^[:CHAR-CLASS:]].

Equivalence classes

For example, the following not only matches an a, but also ä.
[[=a=]]

Links

http://www.adp-gmbh.ch/blog/2005/december/22.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值