m{ .* # match as late as possible ( ^abc$ # the abc .*? # everything up to ^def$ # the def ) }smx
Untested, and will be confused if there are mulitple def lines. In that case it helps to tokenize the input first (for example reading line by line)
In reply to Re: How do I match the closest of repeated strings?
by moritz
in thread How do I match the closest of repeated strings?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |