Build, test, and debug regular expressions
This regex matches strings of 1 to 21 characters consisting solely of uppercase letters (A-Z), whitespace characters, and literal question marks. It's commonly used to validate uppercase-only text fields such as acronyms, codes, or name abbreviations. Note that \s matches any whitespace (spaces, tabs, newlines) rather than just spaces, and the ? inside the character class is treated as a literal character, not a quantifier. The global flag allows finding all matches within a larger text.