Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: regular expression for workdir

by Dietz (Curate)
on Jan 01, 2006 at 15:37 UTC ( #520248=note: print w/ replies, xml ) Need Help??


in reply to regular expression for workdir

This would be more straightforward than the other suggestions:

my ($subpath) = $path =~ m|$magic_word/(.*)/.*|; print $subpath, $/;

Update:

Rereading the question, I misinterpreted it, since my solution will gather all directories after the magic word.
Go with wfsp's solution which fits in perfectly.


Comment on Re: regular expression for workdir
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (12)
As of 2015-07-29 12:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls