w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
perl split multiple commas in line

Assuming that " would not appear as valid value character,

my %hash;
while (my $line = <IN>)
{
  $hash{$1} = ($2 // $3) while $line =~ /(w+)=(?: "(.+?)" | (S+) )/xg;
}




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.