Regular expression: Match everything after a particular word

后端 未结 4 1910
孤街浪徒
孤街浪徒 2020-12-03 06:14

I am using Python and would like to match all the words after test till a period (full-stop) or space is encountered.

text = \"test : match this         


        
4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-03 07:04

    Everything after test, including test

    test.*
    

    Everything after test, without test

    (?<=test).*
    

    Example here on regexr.com

提交回复
热议问题