This regular expresion is not good !!!
---------------------
if ($line=/(.*)=(.*)(#+.*)/){
my ($val,$key,$comment)=($1,$2,$3);
print "Match line : key($key)=val($val) c($comment) \n";
}
---------------------
Example os inputs and the wanted output :
a=b #c => key(a)=val(b) c(#c)
a=b => key(a)=val(b) c()
a="b#" => key(a)=val("b#") c()
a="b#"#ff => key(a)=val("b#") c(#ff)
a="b"#"#ff => key(a)=val("b") c(#"#ff)
Some one can help?