This RegEx is meant to pull the working subdirectory out of a user passed variable, and then do some stuff with it later on. This code works just fine as it is in my testing, but I'd like to know if the RegEx is reasonably robust or if it's gonna break for something stupid. The code will be run exclusively in Win32, but it will be a Japanese OS. Thanks!
$HomePath = $ENV{"WORKHOME"};
$Model = shift;
$Model =~ m/\Q$HomePath\E\\(.*)\\[.\w]+/i;
$WorkingDirectory = $1;
And for those even newer at this than I:
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