home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / news / newusers / question / 5974 < prev    next >
Encoding:
Text File  |  1993-01-23  |  1.9 KB  |  51 lines

  1. Newsgroups: news.newusers.questions
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!nucsrl!ddsw1!dattier
  3. From: dattier@ddsw1.mcs.com (DWT)
  4. Subject: Re: rn KILL file FAQ
  5. Message-ID: <C19vrs.7C8@ddsw1.mcs.com>
  6. Date: Fri, 22 Jan 1993 20:33:27 GMT
  7. References: <killfile.faq_727569363@syrinx.umd.edu> <93021.115925J5J@psuvm.psu.edu>
  8. Organization: Contributor Account at ddsw1, Chicago, Illinois  60657
  9. Lines: 40
  10.  
  11. John A. Johnson <J5J@psuvm.psu.edu> wrote in <93021.115925J5J@psuvm.psu.edu>:
  12.  
  13. | I found [Leanne Phillips's] article on KILL files helpful, but I have a
  14. | question it did not answer.  Suppose I want to search for and junk articles
  15. | with a pattern that might appear in a larger pattern I do not want to junk?
  16. | For example, attempting to junk articles with "male" in the header with
  17. | /male/h:j
  18. | will also junk articles with "female" in the header.  How would I prevent
  19. | this?
  20.  
  21. It's similar to the all-but junking method for which I wrote the example that
  22. Leanne offers to mail out:
  23.  
  24. /female/h:=:M
  25. /male/h:j
  26.  
  27. That's one way.  There's a more direct way that doesn't require returning to
  28. the group nor using the Y command [I'll simplify this under the assumption
  29. that the words will appear in the content of a header line and not in its
  30. name and therefore will not be left-anchored]:
  31.  
  32. /[^e]male/h:j
  33. /[^f]emale/h:j
  34.  
  35. In case you can't make that assumption, add two lines (but four scans are
  36. slower than two, so you might want to use the first method instead):
  37.  
  38. /[^e]male/h:j
  39. /[^f]emale/h:j
  40. /^male/h:j
  41. /^.male/h:j
  42.  
  43. They may be confusing to read because an unescaped caret means "not" inside
  44. brackets but "left anchor" as the first character in a regular expression.
  45. Remember that regexps in rn and trn kill files are case-insensitive.
  46.  
  47. David W. Tamkin   Box 59297   Northtown Station, Illinois  60659-0297
  48. dattier@ddsw1.mcs.com    CompuServe: 73720,1570    MCI Mail: 426-1818
  49.