jchd Posted July 17, 2014 Share Posted July 17, 2014 (edited) Ticket #2778 is asking for an implementation. I don't believe there is a common need for inclusion of such feature in the standard delivery. I compiled the regex.c source from the official SQLite 3.8.5 distribution and tested it. It works decently well but don't expect it to be fast compared to built-in possibilities. Please refer to the official source where you'll find details about supported pattern elements. For those who want to try it, you can download a 32-bit extension DLL. It has been compiled with x86 tcc so it's not highly optimized (which doesn't matter much in this case). You'll find >in this post support to manage SQLite extensions. EDIT: Dropbox once again decided to kill old links. Files are there: sqlite3-pcre.zip sqlite3-pcre-src.zip Edited August 6, 2020 by jchd Solve dead D/L link Luigi 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Andreik Posted July 27, 2014 Share Posted July 27, 2014 Thanks for sharing. I made an example script: #include <SQLite.au3> #include <SQLite.dll.au3> #include <SQLiteExtLoad.au3> Local $aResult, $iRows, $iColumns _SQLite_Startup() $hDB = _SQLite_Open() _SQLite_EnableExtensions($hDB,1) _SQLite_LoadExtension($hDB,@ScriptDir & '\regexp.dll','sqlite3_regexp_init') _SQLite_Exec($hDB,"CREATE TABLE Example(ID int,Data varchar(50))") For $Index = 1 To 2000 _SQLite_Exec($hDB,"INSERT INTO Example(ID,Data) VALUES(" & $Index & "," & _SQLite_FastEscape(RandomChars()) & ")") Next _SQLite_GetTable2d($hDB,"SELECT ID,Data FROM Example WHERE Data REGEXP '^\d{3}'",$aResult,$iRows,$iColumns) _SQLite_Display2DResult($aResult) _SQLite_Close($hDB) Func RandomChars() Local $sChars Local $aCharset = StringSplit('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789','') For $Index = 1 To 50 $sChars &= $aCharset[Random(1,$aCharset[0],1)] Next Return $sChars EndFunc Link to comment Share on other sites More sharing options...
jchd Posted July 27, 2014 Author Share Posted July 27, 2014 Fine, thanks. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
asparagus Posted December 31, 2022 Share Posted December 31, 2022 On 7/28/2014 at 1:23 AM, Andreik said: Thanks for sharing. I made an example script: Hi, Andreik Would you Please show me where can I download the regexp.dll ? Much Thanks Link to comment Share on other sites More sharing options...
asparagus Posted December 31, 2022 Share Posted December 31, 2022 On 7/28/2014 at 1:34 AM, jchd said: Fine, thanks. Hi, Jchd the link https://dl.dropboxusercontent.com/u/26433628/SQLite Extensions/regexp.dll is broken , would you please offer a valid one ? much thanks Link to comment Share on other sites More sharing options...
jchd Posted December 31, 2022 Author Share Posted December 31, 2022 (edited) Easy. Here's the X86 .dll and the source file: sqlite3-pcre.zip sqlite3-pcre-src.zip The regex engine used is PCRE v1, the same as AutoIt currently uses. Edited December 31, 2022 by jchd Skysnake 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
asparagus Posted January 4, 2023 Share Posted January 4, 2023 Hi, jchd , Much Thanks Link to comment Share on other sites More sharing options...
jchd Posted January 4, 2023 Author Share Posted January 4, 2023 BTW these files are the same as in post #1 of this very same thread. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
asparagus Posted January 7, 2023 Share Posted January 7, 2023 On 1/1/2023 at 2:37 AM, jchd said: Easy. Here's the X86 .dll and the source file: sqlite3-pcre.zip 81.17 kB · 18 downloads sqlite3-pcre-src.zip 329.38 kB · 18 downloads The regex engine used is PCRE v1, the same as AutoIt currently uses. Yes , I had downloaded it previously. but it threw an error when I run Andreik's scirpt such as below: ! SQLite.au3 Error --> Function: _SQLite_Query --> Query: SELECT ID,Data FROM Example WHERE Data REGEXP '^\d{3}' --> Error: no such function: REGEXP And of course , Error still occurs when I re-download these files you offer and rename the file to regexp.dll within sqlite3-pcre.zip Would you please tell me what's wrong with it ? Much Tanks Link to comment Share on other sites More sharing options...
jchd Posted January 7, 2023 Author Share Posted January 7, 2023 (edited) Post a _short_ & self-contained reproducer script. Edited January 7, 2023 by jchd This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
jchd Posted January 7, 2023 Author Share Posted January 7, 2023 Sorry, I didn't look at the example code dated 2014! This code was for the first version of the DLL, which used the minimal regex engine available in the SQLite source tree. My version uses a differently named init function. So change the code to: _SQLite_LoadExtension($hDB,@ScriptDir & '\sqlite3-pcre.dll','sqlite3_extension_init') Of course, adapt DLL name and location. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now