Skip to content

Regex implementation #6

@CTRLRLTY

Description

@CTRLRLTY

The regex operator for the match section should not use the underlying default REGEXP from sqlite3.

Create a custom regex parser with limited features and without backreferences.

List of things the regex parser should support:

Symbol Description
\ escape meta character
^ match from beginning or negate a character in bracket expression
. match any single character except newline
| alternation
() grouping
[] bracket expression
* matches zero or more characters
+ matches one or more characters
? matches zero or one character
{count} matches exactly count occurrences of the preceding regular expression
{min,} matches min or more occurrences of the preceding regular expression
{min, max} matches at least min but no more than max occurrences of the preceding regular expression
*? non greedy *
+? non greedy +
?? non greedy ??
{count}? non greedy {count}
{min,}? non greedy {min,}
{min, max}? non greedy {min, max}
\t tab
\n newline
\r carriage return
\f form feed

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions