Functions supporting regular expressions in ORACLE

Source: Internet
Author: User

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,
However, they use POSIX Regular Expressions instead of the old percent sign (%) and wildcard character.
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
'\ 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 the combination of all lowercase letters or numbers
String.
'()' 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 at least
Appears m times.
\ 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
|
Author: "The blog of tantousha"
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.