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"; }
In reply to pattern matching by himanshu.padmanabhi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |