LN Tora wrote: >First, my apologies. I would have gone to the listowners site were it still >up, as I know this is a simple (and silly) question.
Actually, it's not that simple. >I have a virtual domain, and Mailman 2.1.5p1 came with the package. I was >able to set up a list easily enough, but I'm having trouble with >understanding/using the topics feature. From what I can make out, I >actually have to use a regular expression to get it to match the categories >I'm using. While I'm familiar with PHP and Perl to a much lesser extent, I >don't have a clue about Python. Python regular expressions are described at www.amk.ca/python/howto/regex/ and www.python.org/doc/current/lib/re-syntax.html >Basically, I would like to know a basic expression for matching more than >one keyword, using an "and" operator to ensure all the words are found. Unfortunately, this is not something that is easily done with a single regular expression. Suppose you want to both 'black' and 'white' and they could occur in either order. The re '(black|white)' could be used to match the first occurrence of one of these (ignoring that it would also match 'blacker' and so forth) and '(black|white).*(black|white)' would match a first occurrence, followed somewhere by a second, but both could be 'black'. You would need something like '(black.*white)|(white.*black)' to match both words in either order. If you had three words, you would need six alternatives to specify all the possible orderings. In a programming situation you could say something like "IF 'black' is in the string AND 'white' is in the string AND 'grey' is in the string THEN ...". The nature of regular expressions is such that you can't do this directly within a single regular expression. This is because an re specifies a pattern to match against a string and while a pattern can specify alternatives (e.g. black|white) meaning the next part of the string is either black or white, the next part of a string can't be both black and white at the same time so something like 'blackANDwhite' could never match. -- Mark Sapiro <[EMAIL PROTECTED]> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan ------------------------------------------------------ Mailman-Users mailing list [email protected] http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: http://mail.python.org/mailman/options/mailman-users/archive%40jab.org Security Policy: http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp
