Why is the following regex not working in C using regcomp

前端 未结 2 436
滥情空心
滥情空心 2021-01-29 00:30

I have the following regex to match the last pair of braces in a string,

.+(?={)(.+)(?=})

The example string is,

abc{abc=bcd}{g         


        
2条回答
  •  后悔当初
    2021-01-29 01:11

    Uses an anchor to specify the pattern should match when at the end of a line.

    (?<=[{]).*(?=[}]$)

提交回复
热议问题