change in regex drastically reduced false results but also did seem to negatively impact the time it took for the script to run (not hugely but enough to be noticeable)