in reply to how to write this Regular Expression?
This is slightly more direct code won't produce exactly what you asked for but I think it gets to the meaning you're actually looking for.
$strOutputFilename = quotemeta qq['$strInputFilename']; # \'D\:\\direcorty\\file\.ext\'
|
|---|