Test, validate and match regular expressions
Matches abbreviations composed of 2 to 6 uppercase letters or hyphens, optionally followed by a period or newline, and surrounded by whitespace. Useful for extracting acronyms and initialisms from text, such as "NASA", "U.S.", or "A-B". The surrounding whitespace ensures word boundaries and helps isolate tokens. Suitable for preprocessing text in NLP or data cleaning.