- or download this
# skip initial whitespace, if any
$tag =~ /^\s*/gcxs;
...
# check if parsing was successful
die if pos $tag != length $tag;
- or download this
my %quotes;
$quotes{$_} = qr/ \G ( (?: \\. | [^$_] )* ) $_ /xs for qw(' ");
- or download this
if (my $pat = $quotes{$v}) {
$tag =~ /$pat/gc or last;
$v = $1;
$v =~ s/\\(.)/$1/g;
}