Invantive PL/SQL Regex Group catch feature

A nice improvement to Invantive PSQL Regex statements (like regexp_substr) would be the ability to catch groups.

E.g. with a text payload like this:

/api/v1/3670856/financialtransaction/TransactionLines/$count

would like to extract 3670856.

With Invantive’s
\W[\d]+\W' would give /3670856/

With REGEX grouping: \/api\/v1\/([0-9]+)\/financialtransaction\/TransactionLines\/\$count
works as a match in group1 : 3670856.

The use of groups is already possible with regular expression statements, but maybe the question is not understood correctly.

For example:

select regexp_replace('/p1/p2/p3/', '^/([^/]*)/([^/]*)/([^/]*)/', '-$3-$2-$1-')

returns:

.p3.p2.p1.

Please use $ plus digit to refer to the groups, numbered from left to right for opening ‘(’.

Thanks. The group catch was not documented in Invantive’s grammar, and Invantive chatbot said it was not implemented.

:slight_smile: The more correct answer of artificial intelligence would be: “it is documented insufficiently or does not exist”

Groups are not commonly used and we are happy that this topic makes more knowledge available.

The internal workings of the Invantive regular expressions are based on the Microsoft.net implementation. See the documentation for an overview:

The next release of the Invantive UniversalSQL-documentation will include a hint to consult this documentation. Thanks for pointing out the issue.

Dit topic is 7 dagen na het laatste antwoord automatisch gesloten. Nieuwe antwoorden zijn niet meer toegestaan.