Regex to get all character to the right of first space?

前端 未结 4 500
时光说笑
时光说笑 2021-01-14 21:05

I am trying to craft a regular expression that will match all characters after (but not including) the first space in a string.

Input text:

foo bar b         


        
4条回答
  •  暖寄归人
    2021-01-14 21:28

    I'd prefer to use [[:blank:]] for it as it doesn't match newlines just in case we're targetting mutli's. And it's also compatible to those not supporting \s.

    (?<=[[:blank:]]).*
    

提交回复
热议问题