Include definition of \W (#31143)

This commit is contained in:
Dana Ottaviani
2019-01-17 12:41:32 -05:00
committed by Tom
parent 5cf8d966bd
commit c5c1d44bf5

View File

@ -3,4 +3,6 @@ title: 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.
Use`/\W/gi`; to match everything that isn't a-z, A-Z, 0-9, or the _ (underscore) in the string.
You can invert any match by using the uppercase version of the selector `\s` versus `\S` for example.