while (my ($var) = $line =~ s/^(\s*['"]+=//) { # eat single var # eat a single quoted value and its trailing whitespace. $line =~ s/^'([^']+)'\s*// || $line =~ s/^"([^"]+)"\s*// || die "invalid"; # or return, whatever you need } # if we haven't consumed all our input, this line is invalid. die "invalid" if length $line;
In reply to Re: matching a line with ' and "
by gaal
in thread matching a line with ' and "
by rhymejerky
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |