Generate Regex Pattern From String To Int Python