Be more robust about user-given regular expressions