This is sqlite3-pcre2, an extension for sqlite3 that uses libpcre2 to provide the REGEXP() function.
The original source code was written by Alexey Tourbin and can be found at: http://git.altlinux.org/people/at/packages/?p=sqlite3-pcre.git
sudo apt-get install \
libsqlite3-dev \
libpcre2-dev
git clone https://github.com/christian-proust/sqlite3-pcre2
cd sqlite3-pcre2
make
make install
The tests and the documentation can be generated using:
make check
make doc
See test documentation.
-- Test if asdf starts with the letter A with the case insensitive flag
SELECT 'asdf' REGEXP '(?i)^A'
; -- => 1
-- Test if asdf starts with the letter A
SELECT 'asdf' REGEXP '(?i)^A'
; -- => 0
The documentation of the PCRE2 library can be found at: http://pcre.org/.
The regular expression syntax documentation can be found https://perldoc.perl.org/perlre.
- Rename the lib from pcre.so to pcre2.so.
- Use the libpcre2 instead of libpcre.
- Handle a NULL value for both pattern and subject.
- Handle a NULL character into a string.
Updated to work with MacOS. Modified the Makefile to compile and install on MacOS, changed C source code to get rid of "no string" error. (credit to @santiagoyepez for a less hacky fix of explicitly checking for nulls)
The original source code was written by Alexey Tourbin and can be found at: http://git.altlinux.org/people/at/packages/?p=sqlite3-pcre.git