regular expression: match any word until first space

前端 未结 8 1026
情话喂你
情话喂你 2020-12-02 06:20

I have the following line:

hshd    household   8/29/2007   LB

I want to match anything that comes before the first space (whitespace). So,

相关标签:
8条回答
  • 2020-12-02 06:48

    This should do it:

    ^\S*
    
    0 讨论(0)
  • 2020-12-02 06:48

    I think, that will be good solution: /\S\w*/

    0 讨论(0)
提交回复
热议问题