Get the App
SLTechnology News&Howtos  ›  Database  › 

How to use Oracle regular expressions

Shulou Source: shulou.com Published: 2022-05-31 15:05:13 10月30日 Update

This article is about how to use Oracle regular expressions. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

There are four main functions that support regular expressions in oracle regular expression ORACLE:

1REGEXPlayLIKE: the function is similar to LIKE.

2REGEXPlotINSTR: similar to the function of INSTR

3The function of SUBSTR is similar to that of REGEXPSTR.

4REGEXPLACE replace: similar to the function of REPLACE

They are the same in usage as the Oracle SQL functions LIKE, INSTR, SUBSTR and REPLACE

But they use POSIX regular expressions instead of the old percent sign (%) and wildcard (_) characters.

POSIX regular expressions consist of standard metacharacters (metacharacters):

'^' matches the start of the input string, used in square brackets expressions, which indicates that the character collection is not accepted.

The'$'matches the end of the input string. If the Multiline property of the RegExp object is set, $also matches

Match'\ n'or'\ r'.

'.' Matches any single character except the newline character.

'?' Matches the previous subexpression zero or once.

The'+ 'matches the previous subexpression one or more times.

'*' matches the previous subexpression zero or more times.

'|' indicates a choice between two items. The example'^ ([aMusz] + | [0-9] +) $'represents the combination of all lowercase letters or numbers.

String.

'()' marks the start and end position of a subexpression.

'[]' marks a bracketed expression.

'{mdirection n}' an exact range of occurrences, m =

Tags: Expression character comment regular letter number string query integer point function beginning blank English practical similar position address lowercase tag Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Microsoft Huawei vpn MySQL