firebird icon indicating copy to clipboard operation
firebird copied to clipboard

Feature Request: Perl Compatible Regular Expressions

Open realcolaflasche opened this issue 3 years ago • 6 comments

Perl Compatible Regular Expressions where a greate Feature because it's more Powerfull than "similar to".

realcolaflasche avatar Dec 15 '21 14:12 realcolaflasche

Why not do it with external function?

asfernandes avatar Dec 15 '21 15:12 asfernandes

If it is BuildIn it's easier to roll out. In addition, I understand UDR in the way, that I have to define the datatype of the Input- and outputvalue. With a Build-In function it can goes the way like CHAR_LENGTH, there it is not interessting, if the param is a varchar(10), varchar(8000), or texblob.

realcolaflasche avatar Dec 15 '21 15:12 realcolaflasche

What exactly in Perl is "more powerful"?

aafemt avatar Dec 15 '21 15:12 aafemt

For example:

  • positiv/negative lookahead
  • Metasequences
  • Flags like Greedy/Ungreedy, Single Line / Multi Line
  • more predefined class name
  • Something like give a specified group of the regex (i know, there is more to do than use PCRE in similar to)

realcolaflasche avatar Dec 15 '21 16:12 realcolaflasche

What exactly in Perl is "more powerful"?

It can easily crash the server with ReDos.

asfernandes avatar Dec 15 '21 16:12 asfernandes

If it is BuildIn it's easier to roll out. In addition, I understand UDR in the way, that I have to define the datatype of the Input- and outputvalue. With a Build-In function it can goes the way like CHAR_LENGTH, there it is not interessting, if the param is a varchar(10), varchar(8000), or texblob.

There are many use cases for external routines be able to deal with different data types, so I expect one day we will have a solution for this.

asfernandes avatar Dec 15 '21 16:12 asfernandes