himanshu.padmanabhi has asked for the wisdom of the Perl Monks concerning the following question:
This is working well.So I am getting $str="himanshu.txt" Now second case.If I am having cases like $str="himanshu-prg.txt^@" or $str="hel_llo-workd.txt^@"What will the regular expression? CONCLUSION possible patterns; $str= <combination of words,number,dash> . txt (somtimes ^@ gets appended,so i want to sense that and remove)$str="himanshu.txt^@"; if($str =~ /(\w+)/) { $str = "$1.$2"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: pattern matching
by toolic (Bishop) on Mar 04, 2009 at 14:58 UTC | |
by Anonymous Monk on Mar 04, 2009 at 15:02 UTC | |
|
Re: pattern matching
by shmem (Chancellor) on Mar 04, 2009 at 15:44 UTC | |
|
Re: pattern matching
by cdarke (Prior) on Mar 04, 2009 at 14:56 UTC | |
by himanshu.padmanabhi (Acolyte) on Mar 04, 2009 at 15:01 UTC | |
|
Re: pattern matching
by AnomalousMonk (Archbishop) on Mar 04, 2009 at 15:22 UTC | |
|
Re: pattern matching
by GrandFather (Saint) on Mar 04, 2009 at 22:23 UTC | |
|
Re: pattern matching
by Anonymous Monk on Mar 04, 2009 at 14:50 UTC |