Test, validate and match regular expressions
This regex matches a 4-digit number, optionally preceded by a hashtag, which is the classic format for a Discord discriminator (e.g., #1234). It uses a word boundary to prevent matching numbers embedded within longer sequences of digits or text. It is highly useful for extracting or validating Discord user tags from strings or chat logs.