Expression can be simplified on list

Serhiy Storchaka storchaka at gmail.com
Wed Sep 14 06:46:35 EDT 2016


On 14.09.16 11:28, Steven D'Aprano wrote:
> I'm not sure if it makes sense to talk about an "empty regular expression", or
> if that is the same as re.compile(''). Presumably if such a thing makes sense,
> it would match nothing, from any input at all.

Actually, it matches anything. re.compile('').match(x) returns non-false 
value for any valid x.





More information about the Python-list mailing list