... split on the dash ...
That seems to depend on the eighth or other subsequent field being a negative number. In the following, doesn't Sender get its parens zapped?
But it has no dependence on any Perl version above 5.8 — nor indeed, I think, above 5.0!c:\@Work\Perl\monks>perl -wMstrict -le "print 'perl version: ', $]; ;; my $rec = 'Jun 12 10 mail (sender@sender.com) - (recip1@domain.com),(recip2@d +omain.com) 1.889 25623, queued_as: B67837C0052 Subject goes here Send +er(sender@sender.com)'; print qq{'$rec'}; ;; my @F = split /-/, $rec; $F[1] =~ s/[()]//g; my $fixed = join '-', @F; print qq{'$fixed'}; " perl version: 5.008009 'Jun 12 10 mail (sender@sender.com) - (recip1@domain.com),(recip2@doma +in.com) 1.889 25623, queued_as: B67837C0052 Subject goes here Sender( +sender@sender.com)' 'Jun 12 10 mail (sender@sender.com) - recip1@domain.com,recip2@domain. +com 1.889 25623, queued_as: B67837C0052 Subject goes here Sendersende +r@sender.com'
Give a man a fish: <%-{-{-{-<
In reply to Re^4: How can I replace the pattern in the 6 th field?
by AnomalousMonk
in thread How can I replace the pattern in the 6 th field?
by theravadamonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |