What is the difference between \s and \t?

后端 未结 4 603
既然无缘
既然无缘 2020-12-18 00:50

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

4条回答
  •  星月不相逢
    2020-12-18 01:35

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

提交回复
热议问题