Javascript Regular Expression “Single Space Character”

前端 未结 4 1939
礼貌的吻别
礼貌的吻别 2020-12-09 01:49

I am learning javascript and I am analyzing existing codes.

In my JS reference book, it says to search on a single space use \"\\s\"?

But I have

4条回答
  •  醉话见心
    2020-12-09 02:25

    \s matches any whitespace character, including tabs etc. Sure you can use a literal space also without problems. Just like you can use [0-9] instead of \d to denote any digit.

提交回复
热议问题