Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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

by ikegami (Patriarch)
on Aug 01, 2006 at 20:36 UTC ( #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? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2022-08-10 16:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?