Changed regexp to ruby 1.8 syntax to be backwards compatible.