$n = 40000; $_ = "'" . "=" x $n . "'"; printf "Match %d chars\n", length($&) if /'(\\'|''|[^'])+'/;