Re: %d not working in re at Python 2.7?

2012-05-15 Thread Tim Roberts
vacu vacu...@gmail.com wrote: I am frustrated to see %d not working in my Python 2.7 re.search, like this example: (re.search('%d', asdfdsf78asdfdf)).group(0) Traceback (most recent call last): File stdin, line 1, in module AttributeError: 'NoneType' object has no attribute 'group' \d works

%d not working in re at Python 2.7?

2012-05-14 Thread vacu
I am frustrated to see %d not working in my Python 2.7 re.search, like this example: (re.search('%d', asdfdsf78asdfdf)).group(0) Traceback (most recent call last): File stdin, line 1, in module AttributeError: 'NoneType' object has no attribute 'group' \d works fine: (re.search('\d+',

Re: %d not working in re at Python 2.7?

2012-05-14 Thread Josh McGee
% On Friday, May 11, 2012 11:58:01 AM UTC-7, vacu wrote: I am frustrated to see %d not working in my Python 2.7 re.search, like this example: (re.search('%d', asdfdsf78asdfdf)).group(0) Traceback (most recent call last): File stdin, line 1, in module AttributeError: 'NoneType' object

Re: %d not working in re at Python 2.7?

2012-05-14 Thread Tim Chase
On 05/11/12 13:58, vacu wrote: I am frustrated to see %d not working in my Python 2.7 re.search, like this example: (re.search('%d', asdfdsf78asdfdf)).group(0) Traceback (most recent call last): File stdin, line 1, in module AttributeError: 'NoneType' object has no attribute 'group'

Re: %d not working in re at Python 2.7?

2012-05-14 Thread Benjamin Kaplan
On May 14, 2012 7:06 PM, vacu vacu...@gmail.com wrote: I am frustrated to see %d not working in my Python 2.7 re.search, like this example: (re.search('%d', asdfdsf78asdfdf)).group(0) Traceback (most recent call last): File stdin, line 1, in module AttributeError: 'NoneType' object has

Re: %d not working in re at Python 2.7?

2012-05-14 Thread Vacu
Thanks Tim, it is my mis-understanding of usage of %d in Python. After reading it carefully, it should be used in re.scan. The reason I made this dump mistake is because I got a script from our expert and I am totally new on Python, before reading your email, I hadn't a doubt it is wrong usage and