What is the difference between \s and \t?

regex

Solution

`\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

Problem

They both seem to work but I have been told you should use both when you're forming a RegExp?

Original source

Related problems