Pub/sub is a generic messaging model. Subscribers express interest in a certain topic and receive all messages that match that topic, whether it's a wildcard pattern or an exact topic name.
You can have your app subscribe to the room:* topic and receive all messages for all rooms or you can have it subscribe individually to each separate room like room:abc and room:xyz depending on what you need. You can read about the technical workings of pubsub in Redis in this article:
https://making.pusher.com/redis-pubsub-under-the-hood/
In your case, it seems like you want users connected to certain rooms over websockets? Redis doesn't support websockets so you need a server app in the middle. Your app can connect to Redis with a wildcard subscription to room:* and then send the appropriate messages to users over websockets depending on what specific room they're subscribed to, but that logic would have to be in your app. When a user subscribes to a room, you can store that in Redis and then every time your app receives a message, lookup the topic name, see if any users are subscribed, and if there are, send them the message over websockets. This is a simple approach that won't scale infinitely but works well to get going.