in reply to regular expression for workdir
print substr($path, index($path, $magic_word)+length($magic_word)+1); [download]