Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: dir match, dir may or may not appear

by hippo (Bishop)
on Jan 12, 2016 at 10:34 UTC ( [id://1152547]=note: print w/replies, xml ) Need Help??


in reply to Re^2: dir match, dir may or may not appear
in thread dir match, dir may or may not appear

The "?" quantifier means to match 0 or 1 times as specified in the "Quantifiers" section of perlre. Therefore your pattern to match this could be simply (/[^/]+)? which is similar to QuillMeantTen's approach above.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-03-29 06:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found