Perhaps this:
will work for you. - tye => "Tye"while( <DATA> ) { my @m= m{ ^\s* ( \w+ | '(?:\\.|[^\\']+)*' | "(?:\\.|[^\\"]+)*" ) \s* => \s* ( \w+ | '(?:\\.|[^\\']+)*' | "(?:\\.|[^\\"]+)*" ) \s*,?\s*$ }x; print "(", join("|",@m), $/; } __END__ key => 44, "key" => "fun. \"yes\" 'fun'", 'key' => 'yahoo\' "fun"'
In reply to (tye)Re: Regexing a hash line thing
by tye
in thread Regexing a hash line thing
by nutshell
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |