s/\..{3}$//; # UNTESTED

Dirk Bremer - Senior Systems Engineer - ESS/AMS - NISC Lake St. Louis MO
- USA Central Time Zone
636-755-2652 fax 636-755-2503

[EMAIL PROTECTED]
www.nisc.coop 

_______________________________

        From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
        Sent: Thursday, February 16, 2006 07:08
        To: [email protected]
        Subject: Regular expression ;-)
        
        

        Hello, 
        
        a simple regular expression is needed to eliminate the file
extension: 
        
        $_="123"; 
        /(XX)YY/; 
        print "$1\n" ; # result: "123"; 
        
        $_="123.txt"; 
        /(XX)YY/; 
        print "$1\n" ; # result: "123" 
        
        $_="123.txt.txt"; 
        /(XX)YY/; 
        print "$1\n" ; # result: "123.txt"; 
        
        Any suggestions for /(XX)YY/ ? Thanks. 
        
        Kind regards
        Walter Laub
        


_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to