Regex for one or more words separated by spaces

前端 未结 2 711
孤城傲影
孤城傲影 2020-12-09 04:27

I am looking for a regex where i have one or more words (possibly should cover alpha numeric also) separated by spaces (one or more spaces)

  1. \" Test This stuff
2条回答
  •  猫巷女王i
    2020-12-09 04:43

    If you do not care just how many words you have, this would work:

    [\w\s]+
    

    \w is any alphanumeric. Replace it with a-zA-Z if you need only letters.

提交回复
热议问题