Modify regexp match and ignore regexs that don't cleanly match