Sep 03

SQLite throws an error on SQL with REGEXP

Category: Linux,Perl   — Published by goeszen on September 3, 2012 at 8:34 pm

While developing a Dancer application recently, I started using SQL sentences with a REGEXP filter in them. Which resulted in a strange error...
As I found out, SQLite's implementation of the REGEXP function is quite incomplete.

Solution for now:
Make sure you've got a properly updated DBD::SQLite driver for your DBI. Newer versions have a hotfix regexp function that is based on Perl regexes.

The other solution:
Roll your own regexp implmentation, like this.

Leave a Reply