It's not possible*, but John The Ripper has a dynamic format which is closer to what you want:
https://github.com/openwall/john/blob/bl...oc/DYNAMIC
* Unless you code that yourself.
https://github.com/openwall/john/blob/bl...oc/DYNAMIC
* Unless you code that yourself.