regex needs optimization