my( $quote, $quoted, $end )= $string =~ /(['"])((?:\\.|[^'"\\]+|(?!\1)['"])*)(\1?)/; die "Unclosed quote: $quote$quoted\n" if $quote && ! $end; #### /(['"])((?:\\.|[^\1\\]+)*)(\1?)/ #### /(['"])((?:(?:\\.)+|[^\1\\]+)*)(\1?)/ #### /(['"])((?:(?:\\.)+|[^'"\\]+|(?!\1)['"])*)(\1?)/ #### "'" . '\vv'x35_000 . "z'" #### my( $quote, $quoted ); if( $str =~ /(['"])/g ) { my $beg= pos($str); $quote= $1; if( $str !~ /(?