Regex to find last occurrence of pattern in a string

前端 未结 4 1247
一个人的身影
一个人的身影 2021-01-14 00:02

My string being of the form:

\"as.asd.sd fdsfs. dfsd  d.sdfsd. sdfsdf sd   .COM\"

I only want to match against the last segment of whitespa

4条回答
  •  迷失自我
    2021-01-14 00:54

    You can try this. It will capture the last white space segment - in the first capture group.

    (\s+)\.[^\.]*$
    

提交回复
热议问题