Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!uakari.primate.wisc.edu!xanth!talos!kjones From: kjones@talos.uu.net (Kyle Jones) Newsgroups: gnu.emacs.bug Subject: Re: 're-search-backward' bug in Emacs-18.55 Message-ID: <1990Jan2.143701.18670@talos.uu.net> Date: 2 Jan 90 14:37:01 GMT References: <8912301502.AA10078@sgtp.apple.juice.or.jp> Reply-To: kjones@talos.uu.net Lines: 25 Shinichirou Sugou writes: > I think there is a bug in 're-search-backward' function. > [...] > [Reproduction] > (1) Open a empty buffer (says foo); type two characters, SPACE and 'a'; move > the cursor just on the character 'a'. > (2) Eval (re-search-backward "\\`\\|\\s ") > (3) Eval (match-data) > and you will see (# # ) > > [Bug] > In 're-search-backward', not "\\`" but "\\s " should be matched. But > 'match-data' says that actual matching is "\\'". You seem to be assuming that the alternative operator will always match the largest of the two alternatives. The documentation for `\|' does not guarantee this. From the _GNU Emacs Manual_, Section 13.5, "Syntax of Regular Expressions" `\|' applies to the largest possible surrounding expressions. Only a surrounding `\( ... \)' grouping can limit the grouping power of `\|'. This statement applies to the regular expression itself, not the text that is being matched.