They both seem to work but I have been told you should use both when you're forming a RegExp?
\s
matches any whitespace character, including tabs. \t
only matches a tab character.
\t
being a subset of \s
, you should not have to use both at the same time.
\s
matches a single whitespace character, which includes spaces, tabs, form feeds, line feeds and other unicode spaces.
\t
Matches a single tab.
If you are using \s
, you don't need to include \t
.
More information on regex patterns here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With