suniln has asked for the wisdom of the Perl Monks concerning the following question:
What is wrong in this reg exp... Can any one help me out here? Thanks, SunilThe arrary contents are 1. C:\abc\dfg\axy 2. C:\abc\dfg\#@$#@$@\hwllo $key="C:\abc\dfg" $key=~s/(\\[!@#$%^&(),.\}\{[\]+-])/\\$1/g; $line=~s/(\\[!@#$%^&(),.\}\{[\]+-])/\\$1/g; if( $line =~ /$key\\\S+\\/){ # if this is not node ($pat)=$line=~/$key\\(\S+)\\/; }else{ # if end node ($last_node)=$line=~/$key\\(.*)/; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: unable to fomulate right regular expression to fetch the intermediate and last word from a line (windows path) using delimiter "\"
by GrandFather (Saint) on Sep 08, 2010 at 00:41 UTC | |
| |
|
Re: unable to fomulate right regular expression to fetch the intermediate and last word from a line (windows path) using delimiter "\"
by graff (Chancellor) on Sep 08, 2010 at 02:18 UTC | |
|
Re: unable to fomulate right regular expression to fetch the intermediate and last word from a line (windows path) using delimiter "\"
by bart (Canon) on Sep 08, 2010 at 08:05 UTC | |
|
Re: unable to fomulate right regular expression to fetch the intermediate and last word from a line (windows path) using delimiter "\"
by CountZero (Bishop) on Sep 08, 2010 at 06:15 UTC |