Introduction to Oracle 10g Regular Expression REGEXP_LIKE

Source: Internet
Author: User

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!

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.