home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / gnu / emacs / help / 3489 < prev    next >
Encoding:
Internet Message Format  |  1992-07-25  |  1.4 KB

  1. Path: sparky!uunet!wupost!uwm.edu!rutgers!netnews.upenn.edu!widget.seas.upenn.edu!bwoelfel
  2. From: bwoelfel@widget.seas.upenn.edu (Brian Woelfel)
  3. Newsgroups: gnu.emacs.help
  4. Subject: Problem with regexp; not matching maximal # of characters
  5. Message-ID: <84399@netnews.upenn.edu>
  6. Date: 25 Jul 92 04:19:18 GMT
  7. Sender: news@netnews.upenn.edu
  8. Organization: University of Pennsylvania
  9. Lines: 46
  10. Nntp-Posting-Host: widget.seas.upenn.edu
  11.  
  12. Hello all,
  13.  
  14. I'm having a regexp problem.  I think that emacs regexps don't always
  15. slurp up as many characters as they are supposed to.
  16.  
  17. Here are two emacs regexps
  18.  
  19.     (1)    "^\\([ab]+\\|bc\\)+$"
  20.     (2)    "^\\([ab]+\\|bc\\)+"
  21.  
  22. and here is some data:
  23.  
  24.     (i)    aaa
  25.     (ii)    aaaaaabc
  26.     (iii)    aaaabcaaabcbcaaabc
  27.  
  28. Regexp (1) matches all three exactly.  Regexp (2) matches this much:
  29.  
  30.     aaa
  31.     aaaaaab
  32.     aaaab
  33.  
  34. that is, regexp (2) matches (i) exactly, but only parts of (ii) and
  35. (iii).  However, studying regexp (2) shows that it *should indeed*
  36. match all of the data exactly.  The same regexps translated into unix
  37. egrep regular expressions work as I expect, namely both of these:
  38.  
  39.     egrep '^([ab]+|bc)+$'
  40.     egrep '^([ab]+|bc)+'
  41.  
  42. match all the data exactly.
  43.  
  44. Emacs version:
  45. "GNU Emacs 18.58.1 of Tue Mar 24 1992 on central.cis.upenn.edu (berkeley-unix)"
  46.  
  47.  
  48. Is this is a bug in emacs?
  49.   
  50. Is there a better newsgroup to post this question to? 
  51.  
  52.  
  53. Thanks a bunch,
  54.  
  55. Brian Woelfel
  56. Univeristy of Pennsylvania
  57. Programmer for Penn Treebank Project
  58.