[Zope-dev] proposition about the module RegularExpressionConversion

Lucie Lejard lucie at sixfeetup.com
Mon Oct 29 15:31:35 EDT 2007


Hi,

I am using RegularExpressionConversion (from ZConfig/datatypes.py) and 
thought it be neat to have an init method looking like this:

def __init__(self, regex, options):
    self._rx = re.compile(regex, options)

so that we can pass re.DOTALL as an argument for example.
And also have the call method:

def __call__(self, value):
         m = self._rx.match(value)

use "search" instead of "match", to not be forced to have characters 
matching at the beginning of "value".

Is it a good idea? Is there any reason why we couldn't do that?
Thanks
Lucie

-- 
S i x  F e e t  U p , I n c .  |  "Nowhere to go but open source"
Silicon Valley: +1 (650) 401-8579 x605
Midwest: +1 (317) 861-5948 x605
Toll-Free: 1-866-SIX-FEET
mailto:lucie at sixfeetup.com
http://www.sixfeetup.com  |  Zope/Plone Custom Development


More information about the Zope-Dev mailing list