// RegexMatchOnKeys calls a regular expression on keys and provides an iterator.
RegexMatchOnKeys calls a regular expression on keys and provides an iterator.
// RegexMatchOnKeys calls a regular expression on keys and provides an iterator .
func (k *KVStore) RegexMatchOnKeys(expr string, f func(hkey uint64, e storage.Entry) bool) error {
	if len(k.tables) == 0 {
		return nil
	}
	r, err := regexp.Compile(expr)
	if err != nil {
		return err
	}
	for i := len(k.tables) - 1; i >= 0; i-- {
		t := k.tables[i]
		t.Range(func(hkey uint64, e storage.Entry) bool {
			key, _ := t.GetRawKey(hkey)
			if !r.Match(key) {
				return true
			}
			data, _ := t.Get(hkey)
			return f(hkey, data)
		})
	}
	return nil
}
func ( k * KVStore ) RegexMatchOnKeys ( expr string , f func ( hkey uint64 , e storage . Entry ) bool ) error { if len ( k . tables ) == 0 { return nil } r , err := regexp . Compile ( expr ) if err != nil { return err } for i := len ( k . tables ) - 1 ; i >= 0 ; i -- { t := k . tables [ i ] t . Range ( func ( hkey uint64 , e storage . Entry ) bool { key , _ := t . GetRawKey ( hkey ) if ! r . Match ( key ) { return true } data , _ := t . Get ( hkey ) return f ( hkey , data ) } ) } return nil }
RegexMatchOnKeys calls a regular expression on keys and provides an iterator.
RegexMatchOnKeys calls a regular expression on keys and provides an iterator .
// There is nothing to do // Scan available tables by starting the last added table.