View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007244 | MMW v4 | Framework: Scripts/Extensions | public | 2011-01-26 15:12 | 2020-07-01 13:35 |
Reporter | zvezdan | Assigned To | |||
Priority | none | Severity | feature | Reproducibility | always |
Status | new | Resolution | open | ||
Target Version | 4.1 | ||||
Summary | 0007244: Regular expressions in SQL needed | ||||
Description | SQLite allows adding of custom functions. It even has reserved REGEXP operator, but it requires adding of regexp() function to the database engine. It would be nice if you add such thing since it would allow very powerful SQL queries. | ||||
Tags | No tags attached. | ||||
Fixed in build | |||||
|
Reminder sent to: jiri, petr I wonder how I will reflect to MM speed, But REGEXP is surely know of its powers. |
|
I doubt that adding such thing could affect the speed of MM if it is not used by program internally. In fact, I am pretty sure that even the program itself could see a benefit of such added functionality. There is available code for it, I suppose you just need to compile it and include it in the SQLite dll engine: https://www.sqlite.org/src/raw/ext/misc/regexp.c?name=a68d25c659bd2d893cd1215667bbf75ecb9dc7d4 There are other implementations as well, I suppose they are even better since the previous one is quite limited, but I haven't checked them. For example, it seems that this one based on PCRE looks promising: https://github.com/ralight/sqlite3-pcre And if you really decide to implement RegExp, then it would be nice if you add the Regex Replace function as well: https://github.com/gwenn/sqlite-regex-replace-ext |
|
As much as I'd like to have regexp in Sqlite, the proper implementation would probably be non-trivial (full Unicode support, without the need to include complete icu library). I'd rather keep relying on scripting implementation of regexp and possibly try to use this implementation in Sqlite in the future (which would probably be non-trivial, but possible). |
|
Yeah, I helped implementing a TPerlRegEx class based on PCRE library into one text processor and I know this is not a trivial task. But it is doable and it supports Unicode characters without any problem. For example, I could use [^\x00-\xff] with it to find all non-ANSI characters quite well. |