Lexicon has asked for the wisdom of the Perl Monks concerning the following question:
And for those even newer at this than I:$HomePath = $ENV{"WORKHOME"}; $Model = shift; $Model =~ m/\Q$HomePath\E\\(.*)\\[.\w]+/i; $WorkingDirectory = $1;
m/ \Q # Match exact string till \E $HomePath # Start with path from Environment variable \E # End Quote \\ # Backslash (.*) # Working Directory: remember for later \\ # Backslash [.\w]+ # A filename (letters and period) /i # Case insensitive
-Lexicon
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 1: Regex Improvement
by tilly (Archbishop) on Jan 19, 2001 at 17:16 UTC | |
|
Re: Regex Improvement
by knight (Friar) on Jan 19, 2001 at 18:23 UTC | |
|
Re: Regex Improvement
by dws (Chancellor) on Jan 19, 2001 at 12:41 UTC | |
by Lexicon (Chaplain) on Jan 19, 2001 at 13:03 UTC | |
|
Re: Regex Improvement
by I0 (Priest) on Jan 19, 2001 at 15:36 UTC |