Marcelo Giovanni <[EMAIL PROTECTED]> writes:

> How i use the Pyton regex modifiers in filter description?
> 
> like:
> 
> Flag  Meaning  
> DOTALL, S Make . match any character, including newlines 
> IGNORECASE, I Do case-insensitive matches 
> LOCALE, L Do a locale-aware match 
> MULTILINE, M Multi-line matching, affecting ^ and $ 
> VERBOSE, X Enable verbose REs, which can be organized more cleanly and
> understandably 

All of these can be set inline in the regular expression.  See this
page from the Python regular expression documentation.  The syntax is
described about halfway down the page.

http://www.python.org/doc/current/lib/re-syntax.html

For instance, to make the match locale-sensitive, include the string
'(?L)' in your regular expressions.  This matches no characters, but
does set the LOCALE flag.

A couple of notes:  First, TMDA searches are case-insensitve, by
default.  You can specify the '-case' flag in your filter file to make
them case-sensitive.  See TMDA's filter sources documentation.

http://www.tmda.net/filter-sources.html

Finally, although Python regular expressions may be spaced out over
several lines, this is because of Python's triple-quoted strings.  The
TMDA parser does not recognize multiline regular expressions.  If you
use the VERBOSE flag, you can format the expression on one line, to
make it easier to read, but not across multiple lines.  Be sure to
surround the regular expression with quotes if you do this.


Tim
_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users

Reply via email to