What is the regular expression for matching that contains no white space in between text?

后端 未结 3 551
渐次进展
渐次进展 2020-12-10 16:53

I am looking for a regular expression for matching that contains no white space in between text but it may or may not have white space at start or end of text.

3条回答
  •  鱼传尺愫
    2020-12-10 17:43

    This should do it :

    ^\s*\S+\s*$
    
    • " aaadadadad " => matches
    • " aaa aaaaa " => doesn't match

提交回复
热议问题