
In the topic definition form, how can one specify a topic that is only messages that DOES NOT have the string [G2] in it.
Is there a way to test regeps without setting up a separte test list?
Thanks much... Howard

Howard Moscovitz wrote:
In the topic definition form, how can one specify a topic that is only messages that DOES NOT have the string [G2] in it.
see http://docs.python.org/lib/re-syntax.html
I would try
^(?!.*\[G2\])
or if case is not significant
^(?!.*\[[Gg]2\])
but this is only a suggested starting point. It seems to me that it should work, but I don't know.
Is there a way to test regeps without setting up a separte test list?
You could do a few interactive tests with Python or make a script.
For example:
[gpc_ms@clint ~]$ python2.3 Python 2.3.3 (#1, Mar 4 2004, 22:12:33) [GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-113)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import re m = re.match('^(?!.*\[G2\])', 'now is the time for [G3] to do something') m.group(0) '' m = re.match('^(?!.*\[G2\])', 'now is the time for [G2] to do something') m.group(0) Traceback (most recent call last): File "<stdin>", line 1, in ? AttributeError: 'NoneType' object has no attribute 'group'
[gpc_ms@clint ~]$
In the first case, the re matches the null character at the beginning of the line which is followed by not (anything followed by [G2]) so the match succeeds and the matched string is null.
In the second case, the null character at the start of the string is followed by (anything followed by [G2]) so the match fails and m.group is undefined.
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Mark Sapiro wrote:
Howard Moscovitz wrote:
In the topic definition form, how can one specify a topic that is only messages that DOES NOT have the string [G2] in it.
see http://docs.python.org/lib/re-syntax.html
I would try
^(?!.*\[G2\])
or if case is not significant
^(?!.*\[[Gg]2\])
but this is only a suggested starting point. It seems to me that it should work, but I don't know.
Is there a way to test regeps without setting up a separte test list?
You could do a few interactive tests with Python or make a script.
For example:
[gpc_ms@clint ~]$ python2.3 Python 2.3.3 (#1, Mar 4 2004, 22:12:33) [GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-113)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import re m = re.match('^(?!.*\[G2\])', 'now is the time for [G3] to do something') m.group(0)
''
m = re.match('^(?!.*\[G2\])', 'now is the time for [G2] to do something') m.group(0)
Traceback (most recent call last): File "<stdin>", line 1, in ? AttributeError: 'NoneType' object has no attribute 'group'
[gpc_ms@clint ~]$
In the first case, the re matches the null character at the beginning of the line which is followed by not (anything followed by [G2]) so the match succeeds and the matched string is null.
In the second case, the null character at the start of the string is followed by (anything followed by [G2]) so the match fails and m.group is undefined.
Well, I was able to duplicate this result using Python on my computeras you suggested, thank you. I put that regep in the topic filter and people who have selected that topic are still getting messages with [G2] in the subject. Do you have to put the regep in quotes, single or double, on the admin form?
--Howard

Howard Moscovitz wrote:
Mark Sapiro wrote:
Howard Moscovitz wrote:
In the topic definition form, how can one specify a topic that is only messages that DOES NOT have the string [G2] in it.
see http://docs.python.org/lib/re-syntax.html
I would try
^(?!.*\[G2\])
or if case is not significant
^(?!.*\[[Gg]2\])
but this is only a suggested starting point. It seems to me that it should work, but I don't know.
<snip>
Well, I was able to duplicate this result using Python on my computeras you suggested, thank you. I put that regep in the topic filter and people who have selected that topic are still getting messages with [G2] in the subject. Do you have to put the regep in quotes, single or double, on the admin form?
As far as I know, you don't need to quote the regexp in the topic definition, but I don't actually use topics on any list, and when I've played with topics on a test list, I haven't gotten even simple cases to work.
Thus, someone else with experience with topics needs to answer this.
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Howard Moscovitz
-
Mark Sapiro