suniln has asked for the wisdom of the Perl Monks concerning the following question:
Hi All,
I I have following piece of code to fetch intermediate and last node of a string.
for e.g the input lines are as follows.
C:\abc\dfg
C:\abc\dfg\#@$#@$@
$key="C:\abc\dfg";
if( $line =~ /$key\\\S+\\/){ # if this is not end node
($pat)=$line=~/$key\\(\S+)\\/;
}else{ # if end node
($last_node)=$line=~/$key\\(.*)/;
}
What is wrong in this reg exp...
Thanks,
Sunil
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: how insert back slash to a string that has only special characters or mixture of both
by suhailck (Friar) on Sep 06, 2010 at 06:10 UTC | |
by k_manimuthu (Monk) on Sep 06, 2010 at 08:06 UTC | |
by ww (Archbishop) on Sep 06, 2010 at 11:42 UTC |
Back to
Seekers of Perl Wisdom