Re: Content filter and regex flags

Robert Leftwich <[email protected]> Thu, 27 Nov 2003 15:11:36 +1100
Newsgroups gmane.comp.web.mod-pubsub.devel
Message-ID <[email protected]>
At 09:01 AM 27/11/2003, Kragen Sitaker wrote:

>On Thu, Nov 27, 2003 at 08:03:34AM +1100, Robert Leftwich wrote:
> > I'm using kn_content_filter to specify some server-side filtering and in
> > some cases the filter regex will only work if some additional flags are
> > specified when compiling it (e.g. DOTALL, MULTILINE mode, etc). To do this
> > I added a new kn_content_filter_flags element which can be used to specify
> > the required combination of flags (in integer form) which, if present, is
> > passed to the call to re.compile() in pubsub.py.
>
>Can't you just use "(?m:some$^regex)"?

I wasn't aware that the Python regex engine supported the embedded modifer 
syntax, but a bit of testing showed otherwise. Interestingly there is no 
mention of that support in the Python doco.

Thanks for the feedback. I can throw out my changes now and boy, do I just 
love deleting code!

Robert


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.543 / Virus Database: 337 - Release Date: 21/11/2003