Move infinity check upper than regex macher