Message75286
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'] |
|
Date |
User |
Action |
Args |
2008-10-28 15:46:13 | carlosklock | set | recipients:
+ carlosklock |
2008-10-28 15:46:13 | carlosklock | set | messageid: <1225208773.16.0.104236960618.issue4219@psf.upfronthosting.co.za> |
2008-10-28 15:46:12 | carlosklock | link | issue4219 messages |
2008-10-28 15:46:11 | carlosklock | create | |
|