0
0
Redisquery~10 mins

PSUBSCRIBE for pattern matching in Redis - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to subscribe to all channels starting with 'news.'.

Redis
PSUBSCRIBE [1]
Drag options to blanks, or click blank then click option'
Anews+
Bnews?
Cnews.*
Dnews#
Attempts:
3 left
💡 Hint
Common Mistakes
Using '?' which matches exactly one character, not any sequence.
Using '+' or '#' which are not valid Redis pattern wildcards.
2fill in blank
medium

Complete the code to subscribe to all channels ending with '.update'.

Redis
PSUBSCRIBE [1]
Drag options to blanks, or click blank then click option'
A+.update
B?update
C#.update
D*.update
Attempts:
3 left
💡 Hint
Common Mistakes
Using '?' which matches only one character.
Using '+' or '#' which are not Redis wildcards.
3fill in blank
hard

Fix the error in the pattern to subscribe to channels with exactly one character after 'log'.

Redis
PSUBSCRIBE [1]
Drag options to blanks, or click blank then click option'
Alog?
Blog.*
Clog+
Dlog#
Attempts:
3 left
💡 Hint
Common Mistakes
Using '*' which matches any number of characters, not exactly one.
Using '+' or '#' which are invalid in Redis patterns.
4fill in blank
hard

Fill both blanks to subscribe to the channels 'chat.room1' and 'chat.room2'.

Redis
PSUBSCRIBE [1] [2]
Drag options to blanks, or click blank then click option'
Achat.room1
Bchat.room2
Cchat.*
D*.room1
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'chat.*' which matches all channels starting with 'chat.', not just room1 or room2.
Using '*.room1' which matches any channel ending with 'room1', not starting with 'chat.'.
5fill in blank
hard

Fill all three blanks to subscribe to channels matching these patterns: any channel starting with 'user.', any channel ending with '.alert', and any channel containing 'error'.

Redis
PSUBSCRIBE [1] [2] [3]
Drag options to blanks, or click blank then click option'
Auser.*
B*.alert
C*error*
Derror.*
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'error.*' which matches channels starting with 'error.', not containing 'error' anywhere.
Using patterns without '*' which won't match variable parts.