Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: how to extract string by possible groupings?

by adrive (Scribe)
on Jun 03, 2014 at 02:24 UTC ( [id://1088327]=note: print w/replies, xml ) Need Help??


in reply to Re: how to extract string by possible groupings?
in thread how to extract string by possible groupings?

thanks! this is really clear and easy to understand. although, what does the symbol ":?" mean? also..i didn't even know qr can prepare regex pattern.. I guess I'm too rusty in perl!!
  • Comment on Re^2: how to extract string by possible groupings?

Replies are listed 'Best First'.
Re^3: how to extract string by possible groupings?
by LanX (Saint) on Jun 03, 2014 at 02:37 UTC
    > what does the symbol ":?" mean

    its (?:...) not :?

    see (like already mentioned) perlre#Extended-Patterns

    Cheers Rolf

    (addicted to the Perl Programming Language)

Re^3: how to extract string by possible groupings?
by Laurent_R (Canon) on Jun 03, 2014 at 06:49 UTC
    (?:...) is used for non capturing parentheses. This is useful when you need to regroup a subpattern (for example for an alternation or a quantification), but are not interested in capturing the content in $1, $2, etc.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2024-04-26 03:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found