Validator and Sanitizer for HTML 5 attribute regex according to current HTML living standard
The \x{0020} (SPACE) character is already included in \s, you can omit that part.
I prefer to use  \p{Cc} over [:cntrl:] for consistency and because I don't like to have nested square braces in a character class.
I expect isAttributeNameValid() to be checking that the whole string contains NO blacklisted characters.  If you want to match the entire string then you will need &quot;start of string&quot; and &quot;end of string&quot; anchors and a negated character class in your pattern.  But wait, you have a regular character class and you are returning true if one or more blacklisted characters are in the string -- this seems precisely the opposite of what the method name suggests.  Unless I am confused, you should replace (bool) with ! so that you return false when a match is made and true when there are no blacklisted characters found.
I don't know if I agree with the wording of Failed to sanitize attribute name; it seems more truthful to say that the Attribute name had no salvagable characters.