[Mailman-Users] Reg expressions question

Mark Sapiro msapiro at value.net
Mon Jul 23 05:41:57 CEST 2007


Dan Lowe wrote:
>
>On Jul 22, 2007, at 9:08 PM, Jason L wrote:
>
>> I don't know much about regex but in my subjects I need to match say
>>
>> BLAHBLAHBLAH  and anything after it  I tried BLAHBLAHBLAH* but it  
>> doesn't seem to work.
>
>"*" means "match 0 or more of the previous item". So in this case,  
>you are asking to match "BLAHBLAHBLA" followed by 0 or more of "H", e.g.
>
>BLAHBLAHBLA
>BLAHBLAHBLAH
>BLAHBLAHBLAHHHHHHHHH
>
>You probably want to try: BLAHBLAHBLAH.*
>
>"." means "anything", so ".*" means "0 or more of anything".


Correct. Don't confuse regexps with globbing. They aren't the same
thing. For Python regexps, see
<http://docs.python.org/lib/re-syntax.html>.

However, the 'regexp' you used should match, if anything, more than
what you want (i.e., it doesn't require the last character of
BLAHBLAHBLAH), so I suspect there is something else wrong. If you
could explain exactly what you're doing and what you're trying to
accomplish, perhaps we can figure out what that is.

-- 
Mark Sapiro <msapiro at value.net>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan



More information about the Mailman-Users mailing list