better use of regex