diff -r 5b05ceb24a8d -r 87441497ecaa mercurial/commands.py --- a/mercurial/commands.py Mon Mar 11 12:06:13 2013 -0700 +++ b/mercurial/commands.py Mon Mar 11 12:07:33 2013 -0700 @@ -2960,7 +2960,7 @@ if opts.get('ignore_case'): reflags |= re.I try: - regexp = re.compile(pattern, reflags) + regexp = util.compilere(pattern, reflags) except re.error, inst: ui.warn(_("grep: invalid match pattern: %s\n") % inst) return 1