tobias_hofer has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks!
Following is making me crazy, I just want to delete the substring ".xml" from "..\MyXMLFile.xml" by a trim:
my $FileName = "..\\MyXMLFile.xml"; $FileName =~tr/(\.xml)$//d;
But my string is getting to this: "\MyXMLFile" the leading dots are missing. How comes?
When I do it this way - with a search - it works fine..:
my $FileName = "..\\MyXMLFile.xml"; $FileName =~s/(\.xml)$//i;
Why?
Any hints are highly welcome!
Best regards! Tobias
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Regex expression is matching more than once
by Corion (Patriarch) on Apr 22, 2013 at 07:54 UTC | |
by tobias_hofer (Friar) on Apr 22, 2013 at 08:02 UTC | |
Re: Regex expression is matching more than once (regex expressions don't do stuff)
by Anonymous Monk on Apr 22, 2013 at 08:45 UTC | |
Re: Regex expression is matching more than once
by Rahul6990 (Beadle) on Apr 22, 2013 at 08:47 UTC |
Back to
Seekers of Perl Wisdom