in reply to small regex help

Presuming your code was copied correctly, it's not syntactically correct: you're missing the closing slash after the $1. When that's corrected, if I read it correctly (a very big if!), you'll just replace the year and everything to the right of it by the year, and the trailing blanks.

Try this:

#!/usr/bin/perl use strict; use warnings; while(<DATA>){ chomp(); print "before: $_\n"; s/(\d+\s+)(.+)/$1 (Birthday) $2 - singer/; print "after: $_\n"; } __DATA__ January 1, 1915 Franck Pourcel January 3, 1926 George Martin January 3, 1945 Stephen Stills January 3, 1946 John Paul Jones January 4, 1942 John McLaughlin January 5, 1950 Chris Stein

I think this will make the change you want; the regex is the important bit.

emc

e(π√−1) = −1