$var='Hobbs, F. 2005a. Examining American Household Composition: b1990 and 2000. U.S. Census Bureau, Census 2000 Special Reports, CENSR-24. I.S. Government Printing Office, Washington, DC.'; #$var=~s/(\w?) (\w?) ([0-9]{4}+[a-zA-Z]?) (\w?) (\w?)/&identify_year($1.$2.$3.$4.$5)/ge; $var=~s/([0-9]{4})/&identify_year($1)/ge; sub identify_year { my ($input)=@_; print "$input\n"; return ($input); }