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 |