Copied regex changes to original file

Updated regex so gem should work with Ideone; no other changes made.