aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/shell
diff options
context:
space:
mode:
authorJP Appel <jeanpierre.appel01@gmail.com>2025-07-28 01:20:01 -0400
committerJP Appel <jeanpierre.appel01@gmail.com>2025-07-28 01:20:01 -0400
commit3b8dcd30f5aca7624a22cff85a2f767d8d1fb583 (patch)
treedb01e57776ef9a8bc104403cd038e303c6831500 /pkg/shell
parent7b5cd075161bd4e1a05070d51cc64b38882ae74b (diff)
Add regex operator
Implemented regex operator using go flavored regular expressions. Added optimization to combine regex's in `OR` clauses.
Diffstat (limited to 'pkg/shell')
-rw-r--r--pkg/shell/interpreter.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/shell/interpreter.go b/pkg/shell/interpreter.go
index bb0a441..c244c9e 100644
--- a/pkg/shell/interpreter.go
+++ b/pkg/shell/interpreter.go
@@ -86,6 +86,7 @@ var optimizations = []string{
"contradictions",
"compact",
"strictEq",
+ "mergeregex",
}
var commands = map[string]ITokType{
@@ -459,6 +460,8 @@ out:
o.Compact()
case "strictEq":
o.StrictEquality()
+ case "mergeregex":
+ o.MergeRegex()
default:
suggestion, ok := util.Nearest(
optName,
@@ -781,6 +784,7 @@ func PrintHelp(w io.Writer) {
fmt.Fprintln(w, " contradictions - zero contradicting statements and clauses")
fmt.Fprintln(w, " strictEq - zero fuzzy/range statements when an eq is present")
fmt.Fprintln(w, " tighten - zero redundant fuzzy/range statements when another mathes the same values")
+ fmt.Fprintln(w, " mergeregex - merge regexes")
fmt.Fprintln(w, "compile (clause) - compile clause into query")
fmt.Fprintln(w, "execute (artifact) - excute the compiled query against the connected database")
fmt.Fprintln(w, "\nBare commands which return a value assign to an implicit variable _")