Skip to content

Challenge Invert Regular Expression Matches with JavaScript

SaintPeter edited this page · 1 revision
Clone this wiki locally

Invert Regular Expression Matches with JavaScript

Use/\S/gi; to match everything that isn't a space in the string.

You can invert any match by using the uppercase version of the selector \s versus \S for example.

Something went wrong with that request. Please try again.