Closed dorebabu closed 9 months ago
Are you confusing glob-style pattern and regex?
glob-style pattern doesn't support |
.
Hii @sundb Thank you for being here. I used to use this kind of code as part of interacting with redis in version 0.15 of hiredis
reply = redisCommand (g_cfg_db.redis_db_ctxt, "KEYS PORT|E*");
But when I use the same thing now with 1.1.0 , it's not giving me any list of tables though they are present.
So, this glob-style is it deprecated in 1.1.0 ?
And how can I use this now ?
@dorebabu I can't find version 0.15, so i used 0.14 to test and the result is still empty.
AFAIK, The glob-style of the keys command has never had support for |
.
@sundb Is correct. Redis supports glob-style (e.g *
and ?
wildcard) pattern matching, but has never supported the regeg |
OR operator, at least AFAIK.
You can verify this in redis-cli
127.0.0.1:6379> set "KEYS PORT" "some value"
OK
127.0.0.1:6379> set EGGS dozen
OK
127.0.0.1:6379> set ELEPHANTS "are big"
OK
127.0.0.1:6379> keys "KEYS PORT|E*"
(empty array)
127.0.0.1:6379> keys "KEYS PORT"
1) "KEYS PORT"
127.0.0.1:6379> keys "E*"
1) "ELEPHANTS"
2) "EGGS"
Closing, since this isn't a bug in hiredis but happy to answer any other questions.
Hello community,
In version 1.1.0, whereever I use keys E* along with redisCommand to find the tables of redis that start with E, I am not getting any result. Is this feature depricated in this version of hiredis.
Ex:
This doesn't give the tables that start with PORT|E
Thank you .