Test, validate and match regular expressions
Matches one or more consecutive characters that are invalid in Excel worksheet names: backslash, forward slash, question mark, square brackets, and asterisk. The capturing group wraps a character class with a + quantifier so runs of forbidden characters are captured together. Used with the global flag, it finds every occurrence in a string, making it ideal for sanitizing or replacing invalid characters when programmatically generating XLS sheet names.