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

前端 未结 4 501
时光说笑
时光说笑 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-14 21:32

    You can use a positive lookbehind:

    (?<=\s).*
    

    (demo)

    Although it looks like you've already put a capturing group around .* in your current regex, so you could just try grabbing that.

提交回复
热议问题