Search notes:

SQLite function: regexp

Search for records with regular expressions.
regexp is not a built in function, the functionality needs to be imported. In the SQLite shell, with a .load /usr/lib/sqlite3/pcre.so directive.
create table tq84_regexp (
  col text
);

insert into tq84_regexp values ('foo');
insert into tq84_regexp values ('twenty-two: 42');

--
-- pcre.so: needed for regexp--
--
.load /usr/lib/sqlite3/pcre.so

select col from tq84_regexp where col regexp '\d';
--
-- twenty-two: 42

select col from tq84_regexp where col regexp '(.)\1';
--
-- foo

drop table tq84_regexp;
Github repository about-sqlite, path: /functions/regexp.sql
In Ubuntu, pcro.so might be installed with
sudo apt-get install sqlite3-pcre

See also

Using regular expressions in PHP/sqlite.
SQL standard: the features F841, F842, F843, F844, F845 (like_regex, occurrences_regex, position_regex, substring_regex, translate_regex)
functions

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758199138, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/SQLite/functions/regexp(74): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78