Why does the look-behind expression in this regex not have an “obvious maximum length”?

前端 未结 2 1962
太阳男子
太阳男子 2021-01-23 09:23

Given a string containing some number of square brackets and other characters, I want to find all closing square brackets preceded by an opening square bracket and some number o

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-23 10:13

     "^[^\[]*\[[^\]]*?(\])"
    

    is the group(1) what you want?

提交回复
热议问题