http://qs321.pair.com?node_id=169340


in reply to Regex Bug?

It's working perfectly, doing exactly what you ask. The second .*? minimally matches exactly zero characters after the question mark. Remove the minimal operator and it'll do as you intend:

$url =~ s/(.*?)\?.*/$1/;