Add check for valid regex to OutOfContext searches

If you style the curly brackets like they are in the rest of the code I will merge this.