diff --git a/libvore/engine.go b/libvore/engine.go index c952831..b048772 100644 --- a/libvore/engine.go +++ b/libvore/engine.go @@ -446,10 +446,15 @@ func compare(a string, b string, caseless bool) bool { func (es *SearchEngineState) MATCH(value string, not bool, caseless bool) { comp := es.READ(len(value)) + if len(comp) == 0 { + es.BACKTRACK() + return + } + if !not && compare(value, comp, caseless) { es.CONSUME(len(value)) es.NEXT() - } else if not && !compare(value, comp, caseless) && len(comp) > 0 { + } else if not && !compare(value, comp, caseless) { es.CONSUME(len(value)) es.NEXT() } else {