Reputation: 1136
I want to use HSCAN match clause to match a key which is of type 1 or type 2. A regex would be like ^match1|^match2
. Is it possible to do this in glob style pattern.
Upvotes: 2
Views: 1978
Reputation: 49932
You can't use glob-style for that, but you can Lua your way around this. That means you can use
EVAL
and a script (can be similar to https://github.com/itamarhaber/redis-lua-scripts/blob/master/scanregex.lua) for performing the HSCAN match1*
first, and then filtering with Lua on match2.*
.
Upvotes: 1
Reputation: 404
Redis does not offer a straight forward way to match multiple patterns. Redis matchs using glob-style pattern which is very limited.
Supported glob-style patterns:
Use \ to escape special characters if you want to match them verbatim.
Upvotes: 4