[GRASS-user] SQLite REGEXP

Neil Best nbest at lanworth.com
Mon Jul 9 11:29:05 EDT 2007


Glynn Clements wrote:
> Neil Best wrote:
> 
> 
>>Anyone out there have any insight on how to define a regexp() function
>>for SQLite at run-time as described at
>>http://www.sqlite.org/lang_expr.html#regexp
> 
> 
> http://www.sqlite.org/capi3ref.html#sqlite3_create_function
> 
> This would need to be done in the driver (db/drivers/sqlite), probably
> whenever a database is opened (db__driver_open_database, in db.c).
> 
> As for implementation: regcomp/regexec should be available on all Unix
> systems, but you might need a separate library for Windows.
> 

Glynn, thanks for the reply.  Programming at this level is not my strong 
suit so it's difficult for me to gauge how much effort would be involved 
in filling this gap.  I have to wonder why this stub in SQLite has not 
been filled in but it seems like there are enough work-arounds, like 
getting the results from SQLite and using your favorite scripting 
language to do the regex filtering, such that the demand is simply not 
there.  I found a piece of code on the SQLite user list that claims to 
meet this need[1] -- maybe someone would be interested in vetting this. 
  I will write to the author and see what I can learn, especially 
regarding his claim that linking to regex(7) doesn't really solve the 
problem.  The fact that his post generated zero follow-ups is an 
expression of lack of interest in the SQLite community, I would say. 
Thanks.

Neil

[1] http://article.gmane.org/gmane.comp.db.sqlite.general/23584




More information about the grass-user mailing list