This is a my first ever script. I made it to make my work easier.
INSTALLATION :- Just run the Script using the "Run Script" command in your 3Ds max.
Then go to Customize -> Customize User Interface -> Main UI -> nthScript [Category] -> Advanced Renamer
Set your shortcut for the script and RUN...
NOTE:- Keep the Script file and the TempMatLib.mat in the same directory.