[New-bugs-announce] [issue20810] literal re fails to match

Jonathan Epstein report at bugs.python.org
Fri Feb 28 20:06:48 CET 2014


New submission from Jonathan Epstein:

All 3 of these regex's should match, but in practice only m2 does.  Found deep in the bowels of debugging a larger problem.


import re

mainProjectsPath = '/groups/larvalolympiad/larvalolympiad/Projects/'

m1 = re.match('larvalolympiad',mainProjectsPath)
m2 = re.match('.*larvalolympiad.*',mainProjectsPath)
m3 = re.match('/larvalolympiad/',mainProjectsPath)

print(m1)
print(m2)
print(m3)

----------
components: Regular Expressions
messages: 212463
nosy: Jonathan.Epstein, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: literal re fails to match
type: behavior
versions: Python 2.7, Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20810>
_______________________________________


More information about the New-bugs-announce mailing list