diff -r 001e8a745834 -r da8640113b5a mercurial/commands.py --- a/mercurial/commands.py Thu Jul 12 10:55:49 2007 -0400 +++ b/mercurial/commands.py Sat Jul 14 13:34:40 2007 -0500 @@ -1107,7 +1107,11 @@ reflags = 0 if opts['ignore_case']: reflags |= re.I - regexp = re.compile(pattern, reflags) + try: + regexp = re.compile(pattern, reflags) + except Exception, inst: + ui.warn(_("grep: invalid match pattern: %s!\n") % inst) + return None sep, eol = ':', '\n' if opts['print0']: sep = eol = '\0'