Use regex testing to reduce linecount