On 14 Nov 2006 Alexey Tourbin <[EMAIL PROTECTED]> writes:
Hello,
I've just written sqlite3 loadable module which implements REGEXP
operator with Perl-Compatible Regular Expressions library. It has
LRU cache for compiled regular expressions, so it is probably
fast.
$ cflags=`pkg-config --cflags sqlite3 libpcre` $ libs=`pkg-config
--libs sqlite3 libpcre` $ gcc -shared -o pcre.so -Wall -g -fPIC
$cflags pcre.c $libs
Note that regular expression flags can be embedded within regular
expressions themselves, e.g.
sqlite> .load ./pcre.so sqlite> SELECT "asdf" REGEXP "(?i)^A"; 1
sqlite>
This is native perl syntax, and this is what POSIX regex(7) does
not allow (which makes them pretty much useless for REGEXP syntax).
I still consider whether to release the code under the GPL or make
it public domain. Are there any other sqlite3 extensions out there
yet?
see code from original post at
http://article.gmane.org/gmane.comp.db.sqlite.general/23584
I came across this note from last fall while looking for information on
how to activate the REGEXP functionalilty. Not only would I like to know
whether this particular solution is correct and appropriate, but I am
generally curious about why no regexp() function has found its way into
the SQLite code for general distribution. Is it just that there is no
demand because people peform any regex filtering in their favorite
scripting language after obtaining the superset of data from the
database? Personally I would like to be able to narrow my results down
as soon as possible so that the working data is defined by a query to
the extent possible before processing begins. This is my first foray
into the world of SQLite, so I am largely ignorant of the history and
culture of the project, so any back stories would be engightening. FYI,
I was using SQLite to manage attributes of spatial data in the GRASS GIS
environment while our Postgres server was temporarily unavailable. I am
glad to have SQLite in my quiver and I see great potential for making
large data sets more portable, a good compromise between PostGIS and the
inherent shortcomings of the shapefile format. I look forward to any
comments on this topic. Alexey, are you still around? Have you made any
enhancements to your solution?
Neil
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------