makes the regex search more robust