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

Re: Strange result from "abbbbbc" =~ /(b)*?(b*?)c/

by ikegami (Patriarch)
on Aug 01, 2006 at 20:36 UTC ( [id://565072]=note: print w/replies, xml ) Need Help??


in reply to Strange result from "abbbbbc" =~ /(b)*?(b*?)c/

(...)?, (...)*, etc don't really make any sense.
((?:...)?), ((?:...)*), etc would properly capture.

Did you mean (b*?)?

if ("abbbbbc" =~ /(b*?)(b*?)c/) { print("\$1 eq '$1'\n"); # $1 eq '' print("\$2 eq '$2'\n"); # $2 eq 'bbbbb' } else { print("No match\n"); }

I'd file this under GIGO, but Perl has been changed to return a more sensible result in newer versions.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-20 14:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found