Updated regexp generation to better prevent false positives