How use match for different File and rename folder

I have 6 files with different name and extension.
n. AAA.eml
Pippo 875 n AAAA.pdf
n. BBB.eml
Pippo 453 n BBB.pdf
n. CCC.eml
Pippo 678 n CCC.pdf
Now with match “n ‘custom text’” and sort in the subfolder i create Folder with the file that have the same ‘custom text’
Question: how i can rename the folder with the same number after name Pippo of the file?
It’s better move or not to move files Pippo in the subfolder?
Help me......
I would this result
FOLDER -> Pippo 875 (with file n. AAAA.eml and file Pippo 875 n AAA.pdf)
FOLDER -> Pippo 453 (with file n. BBB.eml and file Pippo 453 n BBB.pdf)
FOLDER -> Pippo 678 (with file n. CCC.eml and file Pippo 678 n CCC.pdf)
n. AAA.eml
Pippo 875 n AAAA.pdf
n. BBB.eml
Pippo 453 n BBB.pdf
n. CCC.eml
Pippo 678 n CCC.pdf
Now with match “n ‘custom text’” and sort in the subfolder i create Folder with the file that have the same ‘custom text’
Question: how i can rename the folder with the same number after name Pippo of the file?
It’s better move or not to move files Pippo in the subfolder?
Help me......
I would this result
FOLDER -> Pippo 875 (with file n. AAAA.eml and file Pippo 875 n AAA.pdf)
FOLDER -> Pippo 453 (with file n. BBB.eml and file Pippo 453 n BBB.pdf)
FOLDER -> Pippo 678 (with file n. CCC.eml and file Pippo 678 n CCC.pdf)