Regex to match only uppercase “words” with some exceptions

To some extent, this is going to vary by the “flavour” of RegEx you’re using. The following is based on .NET RegEx, which uses \b for word boundaries. In the last example, it also uses negative lookaround (?<!) and (?!) as well as non-capturing parentheses (?:) Basically, though, if the terms always contain at least one uppercase letter followed by at least … Read more

How to Convert a C++ String to Uppercase

You need to put a double colon before toupper: Explanation: There are two different toupper functions: toupper in the global namespace (accessed with ::toupper), which comes from C. toupper in the std namespace (accessed with std::toupper) which has multiple overloads and thus cannot be simply referenced with a name only. You have to explicitly cast it to a specific function signature in order to … Read more