Invert Regular Expression Matches with JavaScript


You can invert any match by using the uppercase version of the regular expression selector.

For example, \s will match any whitespace, and \S will match anything that isn't whitespace.

Instructions

Use /\S/g to count the number of non-whitespace characters in testString.