The trick here is to use the non-eager version of * (code not tested):
BTW, this also removes the '{'.s/ < # match '<' .*? # match anything, but as short as possible (\{|$) # match either '{' or end of line //x
In reply to Re: Delete till end of line to another string
by rovf
in thread Delete till end of line to another string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |