home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / editors / 1975 < prev    next >
Encoding:
Text File  |  1992-08-12  |  1.6 KB  |  45 lines

  1. Newsgroups: comp.editors
  2. Path: sparky!uunet!sun-barr!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!malgudi.oar.net!chemabs!lwv26
  3. From: lwv26@cas.org (Larry W. Virden)
  4. Subject: Re: Regular Expression Question
  5. Message-ID: <1992Aug13.115656.16757@cas.org>
  6. Followup-To: comp.editors
  7. Sender: usenet@cas.org
  8. Reply-To: lvirden@cas.org (Larry W. Virden)
  9. Organization: Nedriv Software and Shoe Shiners, Uninc.
  10. References: <sjreeves.920812075405@eng.auburn.edu>
  11. Date: Thu, 13 Aug 1992 11:52:27 GMT
  12. Lines: 31
  13.  
  14. In article <sjreeves.920812075405@eng.auburn.edu> sjreeves@eng.auburn.edu (Stan Reeves) writes:
  15. :
  16. :I need to construct a regular expression that locates all words without
  17. :an "@".  I've exhausted all my own ideas and was wondering if I could
  18. :draw on the expertise of this group.
  19.  
  20. Easy I thought, and I typed vi /etc/motd to play.
  21.  
  22. First, I tried:
  23.  
  24. /\<[^@]+\>
  25.  
  26. which is the most obvious thing.  And I got an error.  Oh, vi doesn't appear
  27. to recognize +.  Sigh.  Well, let's try the next most obvious:
  28.  
  29. /\<[^@]*\>
  30.  
  31. That will do it, right?  Nah.  The problem here is that the * eats everything
  32. up to the first @ in the line and treats it all as a string.
  33.  
  34. /\<[^.,<>!@#$%^&*()_-+=|\\{}:;"'~`     ]*\>
  35.  
  36. is close - there may be a few more things that I missed in there, and
  37. there may be a need to quote a couple of those characters.  I gave up
  38. after finding a subset of the above that worked enough to show me the
  39. theory is right...
  40. -- 
  41. Larry W. Virden                 UUCP: osu-cis!chemabs!lvirden
  42. Same Mbox: BITNET: lvirden@cas  INET: lvirden@cas.org
  43. Personal: 674 Falls Place,   Reynoldsburg, OH 43068-1614
  44. America Online: lvirden@aol.com
  45.