various attempts to increase performance of search/regex