fix slow regex