Reputation: 161
(?<=[MVAZ])([^MVAZ]*)(?=[MVAZ]?)
Hi. I want to match everything from 'MVAZ' characters to any other 'MVAZ' characters not in curly braces. If I do not write any 'MVAZ' between curly brackets, pattern works but sometimes I need to use this characters in curly braces.
Upvotes: 1
Views: 36
Reputation: 174706
You may try this,
(?<=[MVAZ])(?:\{[^{}]*\}|[^MVAZ])*(?=[MVAZ])
This would match the curly bracked block greedily if there is any.
Upvotes: 2