Here is the code -
my $s_ver = 'port=":443"; d=3600; v="10,20"'; my $b_ver = 'FB10'; if ($s_ver =~ /(v="[0-9]+(,[0-9]+)*")/ && $b_ver =~ /FB(dd)/){ { print("$1 and $2 "); }
Current Output - 10 and
10 and
Expected output - v="10,20" and 10
v="10,20" and 10
How can this be achieved? Thanks.
if ( ( my ($s_cap) = $s_ver =~ /(v="[0-9]+(?:,[0-9]+)*")/ ) && ( my ($b_cap) = $b_ver =~ /FB(dd)/ ) ) { print("$s_cap and $b_cap "); }
2.1m questions
2.1m answers
60 comments
57.0k users