[news.newusers.questions] Wildcarding in RN Kill Files

wdstarr@athena.mit.edu (William December Starr) (11/25/89)

How can I build a killfile that will match on a character string
within the subject line of an article, regardless of what, if any,
characters precede or follow that string?

For example, I don't care about articles in rec.arts.movies that deal
with movie soundtracks.  What I'd like to do is put into my
~/.../wdstarr/rec/arts/movies/Kill file something like:

	/*oundtrack*/:j

where either asterisk will match on anything.  

I tried reading TFM and, under the heading "Regular Expressions," I
was referred to TFM for the "ed" editor.  I tried reading that and my
eyes glazed over and fell out of my head -- it felt as if I was trying
to decipher IBM documentation from 1977. 

Can anyone please help me on this?  (By the way, I'd also like to know
whether pattern matching in RN is case-specific or not -- will

	/: Soundtracks/:j

cause a match when the actual subject line is "soundtracks"?)
 

efinley%sunset.utah.edu@cs.utah.edu (Elliott Finley) (11/26/89)

(William December Starr) writes:

     How can I build a killfile that will match on a character string
     within the subject line of an article, regardless of what, if any,
     characters precede or follow that string?

     For example, I don't care about articles in rec.arts.movies that deal
     with movie soundtracks.  What I'd like to do is put into my
     ~/.../wdstarr/rec/arts/movies/Kill file something like:

          /*oundtrack*/:j

     where either asterisk will match on anything.  

----
Instead of just using a '*' you need to use '.*'

A '*' will match zero or more occurrences of the character directly
preceding it.  A '.' will match any character, therefore a '.*' will
match any string.  An entry like /.*soundtrack.*/:j will do what you need.

                                Elliot

r4@cbnews.ATT.COM (richard.r.grady..jr) (11/26/89)

In article <1989Nov24.214512.17908@athena.mit.edu> wdstarr@athena.mit.edu (William December Starr) writes:
>
>How can I build a killfile that will match on a character string
>within the subject line of an article, regardless of what, if any,
>characters precede or follow that string?
>
>For example, I don't care about articles in rec.arts.movies that deal
>with movie soundtracks.  What I'd like to do is put into my
>~/.../wdstarr/rec/arts/movies/Kill file something like:
>
>	/*oundtrack*/:j
>
>where either asterisk will match on anything.  

If all you want to do is match on a particular string of characters,
you don't need the asterisks.  Just use

	/soundtrack/:j

The search is not case sensitive, so this matches "Soundtrack" as well.

The only time you need asterisks is to search on TWO strings separated
by an arbitrary number of characters.  For example

	/soundtrack.*music/:j

The "." means any character, and the "*" means zero or more of the
preceeding character, so ".*" matches any number of characters.
The search pattern matches "soundtrack" followed by any number of characters
followed by "music".

--
Dick Grady              r_r_grady@att.com             ...!att!mvuxd!r4 
The above opinions are mine, and not necessarily those of my employer.