M
Marv
Hello,
I'm new to regex and hoping someone can give me a quick answer to this
question as I can't seem to find it anywhere.
I'm trying to parse a line and subsitute any one charactor followed by
a $ and surrounded by a front slash on both sides with the same
charactor followed by a space and "(Drive)". This also must occur at
the beginning of the line. So basically substitute "$" for "(Drive)".
Ex.
/C$/path/path/
ends up as:
/C (Drive)/path/path
I've got the following so far:
$test = '/C$/path/path/';
$test =~ s/^\/.\$/\/.\(Drive\)/;
But when I do: printf "$test\n";
I get:
/.(Drive)/account/test/
I know the dot is wrong, but how do I carry the "C" over in the
substituion.
Thanks in advance.
Marv
I'm new to regex and hoping someone can give me a quick answer to this
question as I can't seem to find it anywhere.
I'm trying to parse a line and subsitute any one charactor followed by
a $ and surrounded by a front slash on both sides with the same
charactor followed by a space and "(Drive)". This also must occur at
the beginning of the line. So basically substitute "$" for "(Drive)".
Ex.
/C$/path/path/
ends up as:
/C (Drive)/path/path
I've got the following so far:
$test = '/C$/path/path/';
$test =~ s/^\/.\$/\/.\(Drive\)/;
But when I do: printf "$test\n";
I get:
/.(Drive)/account/test/
I know the dot is wrong, but how do I carry the "C" over in the
substituion.
Thanks in advance.
Marv