Test, validate and match regular expressions
This regular expression matches sequences of exactly 4, 6, or 8 digits, which are common lengths for One-Time Passwords (OTPs), PINs, or verification codes. It ensures the numbers are preceded by the start of the string or whitespace, and followed by a specific punctuation mark (space, period, comma) plus a non-digit character to avoid matching longer numbers. It is highly useful for parsing SMS messages or emails to automatically extract security codes.