modernise regex and tr a bit