Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Understanding this particular Regex.

by NetWallah (Abbot)
on May 05, 2013 at 07:13 UTC ( #1032110=note: print w/ replies, xml ) Need Help??


in reply to Understanding this particular Regex.

The "+" matches "the previous item" one or more times.

In this case, "the previous item" is a digit [0-9].

So, at least ONE digit is required, but more digits, if present, are acceptable and will match.

In your example of a solitary "4", the "+" does NOT match anything beyond that digit.

The subsequent " *" matches zero or more trailing spaces. See "Quantifiers" in perldoc perlre.

             "I'm fairly sure if they took porn off the Internet, there'd only be one website left, and it'd be called 'Bring Back the Porn!'"
        -- Dr. Cox, Scrubs


Comment on Re: Understanding this particular Regex.
Re^2: Understanding this particular Regex.
by tty1x (Novice) on May 05, 2013 at 07:33 UTC
    Ahh thanks alot for the explanation. Guess my understanding of the + quantifier isn't that great .

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2014-07-28 12:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (196 votes), past polls