Get shortest possible groups in a string using regex

前端 未结 1 1727
渐次进展
渐次进展 2021-01-23 12:29

I have a long string where I need to find all the shortest groups. Currently what is happening is I\'m getting 2 groups, one of which contains all the data in between(it could h

相关标签:
1条回答
  • 2021-01-23 12:46
    START[0-9]+(?:(?!\\bSTART).)*?/END TAG
    

    You can try this.See demo.The lookahead will not allow another START in between your groups.

    https://regex101.com/r/cJ6zQ3/21

    0 讨论(0)
提交回复
热议问题