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

前端 未结 4 496
时光说笑
时光说笑 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:21

    You can also try this

    (?s)(?<=\S*\s+).*
    

    or

    (?s)\S*\s+(.*)//group 1 has your match
    

    With (?s) . would also match newlines

提交回复
热议问题