For the plain upper and lower you can just use $upper($1-) and $lower($1-) respectively, as you\'re changing the whole line.