The solution is to either make the operator non-greedy (put a ? at the end: .*?) or to restate the regexp to get rid of the dot so it doesn't match as much.
In your case though, You'd probably be better off searching CPAN for some modules to parse the mail for you. Parsers are tricky beasts.
In reply to Re: RegExp to delete mail attachments
by swiftone
in thread RegExp to delete mail attachments
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |