How to create a regex that will match an arbitrary sequence of spaces and tabs

前端 未结 4 1017
一生所求
一生所求 2020-12-29 01:33

Could anyone help me to assemble a pattern that matches an arbitrary sequence of spaces and tabs?

4条回答
  •  独厮守ぢ
    2020-12-29 02:21

    \s+ should capture all whitespace, including spaces, tabs, carriage returns, and some weird whitespace characters. Use \s* if you want it to be optional.

提交回复
热议问题