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