What is the difference between \s and \t?

后端 未结 4 599
既然无缘
既然无缘 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:42

    \s contains all whitespace characters. For example, in Java, \s is [\t\n\x0b\r\f]. \t is just a single tab, so you don't need to use both.

提交回复
热议问题