[Python-ideas] Adding function checks to regex

Raymond Hettinger raymond.hettinger at gmail.com
Sat Mar 19 22:26:16 CET 2011

On Mar 19, 2011, at 2:07 PM, Antoine Pitrou wrote:

> On Sat, 19 Mar 2011 03:25:57 +0000
> MRAB <python at mrabarnett.plus.com> wrote:
>> However, it occurs to me that there may be a case for being able to call 
>> a supplied function to perform such checking.
> What would be such a case?
> Adding more complications to the regex syntax and semantics is
> something most of us would frown upon, IMHO. *Especially* if it involves
> mixing in arbitrary Python callbacks referenced by name in the regex...

I concur with Antoine.
The re module and syntax already present a learning challenge.
Adding more features (especially non-standard ones) would 
make the situation worse, even if if it simplified some particular use case.


More information about the Python-ideas mailing list