Negative look-ahead in Go regular expressions

前端 未结 3 1701
日久生厌
日久生厌 2020-12-03 09:54

I\'m trying to use negative look-aheads in Go.

The following regular expression: BBB(((?!BBB).)*)EEE

http://rubular.com/r/Zw1vopp1MF

Howeve

3条回答
  •  被撕碎了的回忆
    2020-12-03 10:13

    Based off your examples and your expected output, the following would work.

    re := regexp.MustCompile(`BBB([^B]*)EEE`)
    

    GoPlay

提交回复
热议问题