Computers are a mystery. Thanks for the update.
Usually that error occurs when there is incorrect syntax, such as an uneven number of opening ( or closing brackets ), or if we forget to actually define which character we want to match, eg. title>(*?)</title will throw an error.