Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Regex Bug?

by chromatic (Archbishop)
on May 26, 2002 at 06:34 UTC ( #169340=note: print w/replies, xml ) Need Help??


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/;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://169340]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2022-12-04 19:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?