tiny regex global flag fixes