This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author carlosklock
Recipients carlosklock
Date 2008-10-28.15:46:11
SpamBayes Score 1.1685027e-09
Marked as misclassified No
Message-id <1225208773.16.0.104236960618.issue4219@psf.upfronthosting.co.za>
In-reply-to
Content
Hello, 

I am having a weird problem with regex. I am trying to get the tokens
that match the pattern below, but it is not working only for a specific
case. I do this for many lines of text, and it works, except for the
string '1214578800'.

Any idea of what is happening? Is it a problem of my code or a bug in
regular expressions?

Thanks for any help,

Carlos.



import re
r =
re.compile(",'([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])'[,|)]")
text =
"('25','2','3','2','0','1','0','0/350','30','21','5','','1211641200','1214578800','0','2','1214662622');"
timestamps = r.findall(text)
print timestamps


OUTPUT:
Python 2.5.2 (r252:60911, Jul 31 2008, 17:31:22) 
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on Trabalho15, Standard
>>> ['1211641200', '1214662622']
History
Date User Action Args
2008-10-28 15:46:13carlosklocksetrecipients: + carlosklock
2008-10-28 15:46:13carlosklocksetmessageid: <1225208773.16.0.104236960618.issue4219@psf.upfronthosting.co.za>
2008-10-28 15:46:12carlosklocklinkissue4219 messages
2008-10-28 15:46:11carlosklockcreate