Page 1 of 1

Differences between the regular expression times symbol in ORACLE and openGauss

Posted: Thu Jan 23, 2025 9:22 am
by Rina7RS
There are many so-called "standard functions" that have different "standards" in different environments. These "standards" have their own criteria, and after years of development, it is difficult to force consistency. Even commonly used functions such as regular expressions have different standards, so don't expect ANSI SQL to make any identical statement run with the same results in every database. In the process of eliminating O, you can often find a lot of application codes that were not written in a standard way in the past. Now is a good opportunity to make these codes more standardiz.

report Gauss Squirrel Club Assistant Posted on 2025/01/10 15:18:17 6.2k+ 0 0
【Abstract】 Regular expressions are a common way to process strings. In various development languages ​​and even databases, there are built-in regular expression functions. However, there are many standards kuwait phone number data for regular expressions, and different standards parse regular expressions differently. This time, when migrating an ORACLE database to openGauss, a difference about {} was found.
image.png

Author: DarkAthena

1. Introduction
As a common string processing method, regular expressions are built-in in various development languages ​​and even databases. However, there are many standards for regular expressions, and different standards parse regular expressions differently. This time, when migrating an ORACLE database to openGauss, a difference in {} was found.

2. What is {} used for?
In most regular expression rules, {} represents the number of repetitions of the preceding character. The supported formats are {m}, {m,}, {,n}, and {m,n}, where m and n are both natural numbers. For example,

3. Ambiguity in the use of {}
The following three SQL statements can all be executed in ORACLE.