XP is just a number | |
PerlMonks |
Re: Help with a regexby WiseGuru (Initiate) |
on Sep 08, 2007 at 08:27 UTC ( [id://637803]=note: print w/replies, xml ) | Need Help?? |
try my $string="testing.123"; my @Strings; @Strings=split(/\./,$string); if($Strings[$#Strings] eq "123"){ DoSomething.... } this way you have got the last chunk of the string divided by a period, always, because if there is more than one period then you might not get what you want, but if you have ONLY ONE period and can garrantee it, then use my $string="testing.123"; my $string2; ($string,$string2)=split(/\./,$string); if($string2 eq "123"){ DoSomething.... } good luck! www.arobcorp.com
In Section
Seekers of Perl Wisdom
|
|