Author bo qu
Recipients bo qu, ezio.melotti, mrabarnett
Date 2017-04-01.07:38:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491032329.85.0.64760293799.issue29959@psf.upfronthosting.co.za>
In-reply-to
Content
if "[" is the first char in a string, then re.match can't match any pattern from the string, but re.findall works fine

details as follows:

[da@namenode log]$ python3
Python 3.4.3 (default, Jun 14 2015, 14:23:40) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> cyzd="[abc]"
>>> cyzd
'[abc]'
>>> pattern="ab(.*)"
>>> pattern
'ab(.*)'
>>> match=re.match(pattern, cyzd)
>>> match
>>> pattern=r'ab(.*)'     
>>> re.findall(pattern, cyzd)
['c]']
History
Date User Action Args
2017-04-01 07:38:49bo qusetrecipients: + bo qu, ezio.melotti, mrabarnett
2017-04-01 07:38:49bo qusetmessageid: <1491032329.85.0.64760293799.issue29959@psf.upfronthosting.co.za>
2017-04-01 07:38:49bo qulinkissue29959 messages
2017-04-01 07:38:49bo qucreate