N
Nigel Scott
Hi
I am writing a piece of perl for processing emails and part of the
process involves finding the boundaries of multiple MIME parts.
I am trying to extract the boundary from the headers using a pattern
like this:
my $pattern = ".*boundary *= *[\'\"]*(.*)[\'\"]*.*";
This is to cover the cases where the boundary itself may be contained in
double quotes, single quotes or no quotes at all. For some reason
though, if the boundary is contained double quotes, eg.
Content-Type: multipart/mixed;
boundary="----=_Part_174034_7372797.1070374686532"
and I use:
my $boundary =~ s/$pattern/$1/is;
$boundary becomes ----=_Part_174034_7372797.1070374686532'
with an extra single quote on the end.
I have tried looking at various perl and regexp tutorials, but I can't
work out what is wrong with my pattern.
Any help appreciated,
Nige.
I am writing a piece of perl for processing emails and part of the
process involves finding the boundaries of multiple MIME parts.
I am trying to extract the boundary from the headers using a pattern
like this:
my $pattern = ".*boundary *= *[\'\"]*(.*)[\'\"]*.*";
This is to cover the cases where the boundary itself may be contained in
double quotes, single quotes or no quotes at all. For some reason
though, if the boundary is contained double quotes, eg.
Content-Type: multipart/mixed;
boundary="----=_Part_174034_7372797.1070374686532"
and I use:
my $boundary =~ s/$pattern/$1/is;
$boundary becomes ----=_Part_174034_7372797.1070374686532'
with an extra single quote on the end.
I have tried looking at various perl and regexp tutorials, but I can't
work out what is wrong with my pattern.
Any help appreciated,
Nige.