SQLite includes syntactic support for an infix operator REGEXP , but without any implementation.
The DBD::SQLite driver automatically registers an implementation that performs standard perl regular expression matching , using current locale.
So for example you can search for words starting with an A with a query like
SELECT * from table WHERE column REGEXP '\bA\w+'
If you want case-insensitive searching, use perl regex flags, like this :
SELECT * from table WHERE column REGEXP '(?i:\bA\w+)'
The default REGEXP implementation can be overridden through the create_function API described above.
Note that regexp matching will not use SQLite indices, but will iterate over all rows, so it could be quite costly in terms of performance.
Short version: Perl regexes are hooked into sqlite using a callback mechanism. But filtering row-wise. That's much slower than a native implementation.
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
In reply to Re: Documentation of REGEXP support in DBD::SQLite?
by LanX
in thread Documentation of REGEXP support in DBD::SQLite?
by ibm1620
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |