How to implement table scan

I need to hold info in RocksDB, while the index is a regex.
I am trying to check how to implement the table scan?

Reply by Hilik, Speedb’s co-founder and chief scientist:

Searching of keys that matches a general regular expression is not possible without a full scan of the table . If this is a feature that would get enough votes it is possible to optimise the search internally (skipping values that may not match) .

Reply from the question’s author: ‘Thanks for your answer. Will it be better if we load the table to the memory and check it in the memory?’

Reply by Hilik, Speedb’s co-founder and chief scientist:

depending on the table size and the regular expression. The regular expression optimisations that I am aware of works on a large set of keys so I think download a large portion of keys and than running the search would make sense. Note that to get a consistent point in time you need either to scan all the data using the same iterator or else take a snapshot.