The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 10-13-2008
KevinADC KevinADC is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2008
Posts: 731
Use the \W character class to split the string. \W is the compliment of \w which is a-zA-Z0-9_


Code:
$string = "December 12, 1995";
($month,$day,$year) = split(/\W+/,$string);
print "$month\n$day\n$year";