#!/usr/bin/perl -w
# http://t...content-available-to-author-only...h.net/test/read.cgi/tech/1330666216/658
use strict;
my $str = q/test"xx&xx'x"xxx'xx&xx'xxxxx&yyyyy&zzz/;
$str =~ /
((?:
(['"]) (?:\\\2|.)+? \2 |
[^'"&]
)+)&
/x;
print "1:[$1]\n2:[$']\n";
IyEvdXNyL2Jpbi9wZXJsIC13CiMgaHR0cDovL3QuLi5jb250ZW50LWF2YWlsYWJsZS10by1hdXRob3Itb25seS4uLmgubmV0L3Rlc3QvcmVhZC5jZ2kvdGVjaC8xMzMwNjY2MjE2LzY1OAp1c2Ugc3RyaWN0OwpteSAkc3RyID0gcS90ZXN0Inh4Jnh4J3gieHh4J3h4Jnh4J3h4eHh4Jnl5eXl5Jnp6ei87Cgokc3RyID1+IC8KICAoKD86CiAgICAoWyciXSkgKD86XFxcMnwuKSs/IFwyIHwKICAgIFteJyImXQogICkrKSYKL3g7CgpwcmludCAiMTpbJDFdXG4yOlskJ11cbiI7Cg==