Re: MT NewsWatcher filtering



In article <jollyroger-E5A2AA.12443624092009@xxxxxxxxxxxxxxxxxxx>,
Jolly Roger <jollyroger@xxxxxxxxx> wrote:

In article <240920091009328094%jimsgibson@xxxxxxxxx>,
Jim Gibson <jimsgibson@xxxxxxxxx> wrote:

In article <jollyroger-C54572.11211424092009@xxxxxxxxxxxxxxxxxxx>,
Jolly Roger <jollyroger@xxxxxxxxx> wrote:


Kill if Subject Matches the regular expression: [123456]+

The plus sign shouldn't be necessary for most regular expression
engines. The regular expression "[123456]" will match if any one
character 1-6 exists in the string. You don't really care if there is a
set of one or more, just if any character in the set given in brackets
([]) exists in the string you are testing.

I'm not prepared to make that assumption. It may very well be the OP
wants to match one or more of the offending characters, in which case
the + would be required. It would be very helpful to have some real
examples of subjects he wants to match, of course.

Sure, the OP needs to adapt the suggestions made here to his/her
situation. I am just trying to point out that the plus sign is not
necessary in the case you have given, because any string that matches
[123456] will match [123456]+, and vice versa if all you are looking
for is a match/no match decision. It is a small point, but some might
be confused by its inclusion.

The plus sign might be necessary if the [123456] is part of a more
complex regular expression. For example, the string "a12b" will match
the regular expression "a[123456]+b" but not the RE "a[123456]b". In
that case, it makes a difference.

Disclaimer: I am not familiar with the regular expression engine in MT
Newswatcher.

--
Jim Gibson
.



Relevant Pages

  • Small regular expression parser
    ... the goal was to develop a very simple regular expression parser. ... sets are selected using the % character instead of \. ... into the string of the start of the match and the length of the match. ... Last there are a couple macros to help with captures. ...
    (comp.lang.lisp)
  • Re: Brian Kernighan, maybe Im not worthy, maybe Im scum
    ... abandoned it because I don't think Beautiful Code can be written in C: ... Pike's code doesn't implement a regular expression interpreter ... it makes no provision for a character which must occur at ... changeable index into the string it points-at and it expects the user ...
    (comp.programming)
  • Re: Checking last character of string for punctuation
    ... I'm a newbie with a newbie question. ... the string should be kept as is. ... This matches your string against the regular expression that you need to put ... Given the description of your problem, you might be interested in character ...
    (perl.beginners)
  • Re: Reading a variable line by line with while loop
    ... actual duplicates there were in the file to begin with. ... regular expression to say "if this string exists within the larger ... and maybe someone can correct my regular expression so it works to weed ... inside of brackets treats it as a literal character ...
    (Ubuntu)
  • Re: RegularExpressions
    ... Start at the beginning of the string, or at the first line break character ... Basically, that is what a regular expression does, but in a more roundabout ... Notice that before the word BRE there are some other info that I dont ...
    (microsoft.public.dotnet.framework)