mhooper has asked for the wisdom of the Perl Monks concerning the following question:

newbie to Perl I'm trying to convert an existing sed replacement into a perl field substitution sed -r "s/(.*<sip:)(.*)(@.*)/\2/g" trying to get output of only the value between <sip: and @ for parsing out phone data in field such as "My Name <sip:+15555551212@192.168.0.200" and all I want out is +15555551212. thank you Murray

Replies are listed 'Best First'.
Re: sed equivalent in perl
by Anonymous Monk on Mar 07, 2017 at 17:52 UTC
    my $str ='My Name <sip:+15555551212@192.168.0.200'; (my $val) = $str =~ /:([^\@]+)/; print "$val\n";
      Thank you