Oracle 10g Regular ExpressionOfREGEXP_LIKEThe usage is what we will introduce in this article. Before that, let's take a look at the regular expressions supported by Oracle 10g. There are four functions that support regular expressions in Oracle:
1. REGEXP_LIKE: similar to LIKE.
2. REGEXP_INSTR: similar to INSTR.
3. REGEXP_SUBSTR: similar to SUBSTR.
4. REGEXP_REPLACE: similar to REPLACE.
They are used in the same way as Oracle SQL functions LIKE, INSTR, SUBSTR, and REPLACE, but they use POSIX Regular Expressions instead of the old percent signs %) and wildcard characters.
POSIX regular expressions are composed of standard metacharacters:
'^' Matches the start position of the input string and is used in the square brackets expression. In this case, this character set is not accepted.
'$' Matches the end position of the input string. If the Multiline attribute of the RegExp object is set, $ also matches '\ n' or' \ R '.
'.' Matches any single character except the line break.
'? 'Match the previous subexpression zero or once.
'+' Matches the previous subexpression once or multiple times.
'*' Matches the previous subexpression zero or multiple times.
'|' Indicates an option between the two items. Example '^ ([a-z] + | [0-9] +) $' indicates a string composed of all lowercase letters or numbers.
'()' Indicates the start and end positions of a subexpression.
'[]' Indicates a bracket expression.
'{M, n}' indicates the exact number of occurrences. m = <number of occurrences <= n, '{m}' indicates m occurrences, '{m ,} 'indicates that at least m occurs.
\ Num matches num, where num is a positive integer. References to the obtained matching.
Character cluster:
[[: Alpha:] any letter.
[[: Digit:] any number.
[[: Alnum:] Any letter or number.
[[: Space:] any white characters.
[[: Upper:] Any uppercase letter.
[[: Lower:] Any lowercase letter.
[[: Punct:] Any punctuation marks.
[[: Xdigit:] Any hexadecimal number, which is equivalent to [0-9a-fA-F].
Operation priority of various operators
\ Escape Character
(),(? :),(? =), [] Parentheses and square brackets
*, + ,?, {N}, {n ,}, {n, m} qualifier
^, $, Anymetacharacter location and Sequence
Here is an introduction to the use of Oracle 10g Regular Expression REGEXP_LIKE, the composition of regular expressions, and the priority of operators. I hope this introduction will be helpful to you!