/ Published in: Other
Expand |
Embed | Plain Text
(?<!\)[(\[|\]|[^[]]|(?<!\)[.*(?<!\)])*(?<!\)]
Comments
Subscribe to comments
You need to login to post a comment.
(?<!\)[(\[|\]|[^[]]|(?<!\)[.*(?<!\)])*(?<!\)]
Subscribe to comments
You need to login to post a comment.
This regular expression will find the highest level groups within recursive tokens. For instance, if I have "This is [just [an] example] of the [expression]", it'll find [just [an] example] and [expression], and nothing else. It will also not find an escaped bracket expression. If you want to replace the bracket with curly braces or parenthesis, be careful. As an example, curly braces will be: (?
well that snippet didn't go in... maybe that way: (?<!\){(\{|\}|[^{}]|(?<!\){.(?<!\)})(?<!\)}
well that snippet didn't go in... maybe that way: (?<!\){(\{|\}|[^{}]|(?<!\){.(?<!\)})(?<!\)}