John the Ripper part of known password

For the purpose of migration, I need to get the password in clear text for all our accounts, stored in the shadow file.

Our system uses user names in the format "firstname.lastname" and the password is "firstname + unique number + unique letter" or "lastname + unique number + unique letter", such as "firstname3p" or "lastname3p" "

What is the right way to use the filters to extract the first name or the name and try each combination of digit + letter on them?