I want to use Text::Balanced to extract some markup that uses {{...}} and [[...]] to markup its hyperlinks. For example:
This line contains {{path:to:mediafile|a hyperlink}} and [[path:to:page|another]] too.
extract_bracketed() is smart in the sense that it knows about bracket pairs --{}, [], <>, ()-- and looks for opening and closing brackets that are the same "shape". I can't use it, though, because it only works with single-character brackets.
I can use extract_tagged() to find one such type of "fat bracket" at a time, but it would be nice if it understood several symmetric bracket pairs.
Is there a way to use Text::Balanced to extract strings that are enclosed by either {{ and }}, or [[ and ]], but not {{ and ]], for example?
Since they can't be nested, it can be done rather easily without Text::Balanced.