Tim Peters added the comment:

Antoine, that's certainly the conceptual intent here.  Can't say whether your 
attempt works in all cases.  The docs don't guarantee it.  For example, if the 
original regexp started with (?x), the docs explicitly say the effect of (?x) 
is undefined "if there are non-whitespace characters before the [inline (?x)] 
flag".

Sure, you could parse the regexp is user code too, and move an initial 
(?...x...) before your non-capturing group.  For that matter, you could write 
your own regexp engine in user code too ;-)

The point is that it should be easy for the regexp engine to implement the 
desired functionality - and user attempts to "fake it" have pitfalls (even 
Guido didn't get it right - LOL ;-) ).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16203>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to