Capturing groups for regexp.c Check-in [3d6fba62] ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Capturing groups for regexp.c Check-in [3d6fba62] ?

petern
Richard.  Please consider adding capturing groups during your upgrade of
the regexp.c matching capability.

In addition to the adding a powerful new capability to all SQLite
expressions, it would be very instructive to see how your code obtains the
cached object for a pair of captured group accessors such as
regexp_group_count(R) and regexp_group(R,I) where R is the common regexp
and I is the index of the captured group text to be retrieved.

Peter
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Capturing groups for regexp.c Check-in [3d6fba62] ?

Richard Hipp-3
On 1/1/18, petern <[hidden email]> wrote:
> Richard.  Please consider adding capturing groups during your upgrade of
> the regexp.c matching capability.

I did consider that.  It seems hard to do in linear time.  I also
notice that neither JavaScript nor AWK support that capability.

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Capturing groups for regexp.c Check-in [3d6fba62] ?

petern
Indeed, but JavaScript and awk also have first class loop accessible
variables to make up for the limitations in their respective regex parsers.

About linear time. Are you saying it is slower than linear time to compile
a group captured regex or that it is impossible to efficiently reuse the
compiled object in the body of a complementary UDF in the same statement?

All sorts of ad hoc parsing functions are possible and I use quite a few in
my code.  However, as I pointed out in the carefully worked test case
linked below, there is presently no reliable way to share that parsed state
among functions with different names, in different columns, or of column
valued objects using the thread safe auxdata API.  Those improvements in
the auxdata API alone would be valuable without the regexp capture
capability.

https://www.mail-archive.com/sqlite-users@.../msg107041.html

BTW, it is not only my possibly eccentric boutique code that is running
into this problem:

https://www.mail-archive.com/sqlite-users@.../msg107045.html



On Mon, Jan 1, 2018 at 10:44 AM, Richard Hipp <[hidden email]> wrote:

> On 1/1/18, petern <[hidden email]> wrote:
> > Richard.  Please consider adding capturing groups during your upgrade of
> > the regexp.c matching capability.
>
> I did consider that.  It seems hard to do in linear time.  I also
> notice that neither JavaScript nor AWK support that capability.
>
> --
> D. Richard Hipp
> [hidden email]
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users