Oracle的REGEXP_INSTR函数简单用法

Oracle的REGEXP_INSTR函数用于搜索正则表达式模式的字符串,返回开始匹配的位置。函数接受源字符串、模式、起始位置、出现次数、返回选项和匹配参数等参数,支持匹配单个字符、多个字符及多个备选方案。例如,查找字符串中的第一个特定字符位置,或多字符模式的首次出现,甚至在指定位置开始的匹配。
摘要由CSDN通过智能技术生成

REGEXP_INSTR函数让你搜索一个正则表达式模式字符串。函数使用输入字符集定义的字符进行字符串的计算。

它返回一个整数,指示开始或结束匹配的子位置,这取决于return_option参数的值。如果没有找到匹配,则函数返回0。

语法

Oracle数据库中的REGEXP_INSTR函数的语法是:

REGEXP_INSTR (source_char, pattern [, position [, occurrence [, return_option [, match_parameter ] ] ]  ] )

参数

source_char

搜索值的字符表达式,可以是任何数据类型CHAR,VARCHAR2,NCHAR,NVARCHAR2,CLOB或NCLOB的。

pattern

正则表达式

Value Description
^ Matches the beginning of a string. If used with a match_parameter of ‘m’, it matches the start of a line anywhere within expression.
$ Matches the end of a string. If used with a match_parameter of ‘m’, it matches the end of a line anywhere within expression.
* 匹配零个或多个.
+ 匹配一个或多个出现.
? 匹配零次或一次出现.
. 匹配任何字符,除了空.
| Used like an "OR" to specify more than one alternative.
[ ] Used to specify a matching list where you are trying to match any one of the characters in the list.
[^ ] Used
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值