regex question on .findall and \b
ethan at stoneleaf.us
Thu Jul 2 13:12:32 EDT 2009
Ethan Furman wrote:
> My closest to successfull attempt:
> Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit
> Type "copyright", "credits" or "license" for more information.
> IPython 0.9.1 -- An enhanced Interactive Python.
> In : re.findall('\d+','this is test a3 attempt 79')
> Out: ['3', '79']
> What I really want in just the 79, as a3 is not a decimal number, but
> when I add the \b word boundaries I get:
> In : re.findall('\b\d+\b','this is test a3 attempt 79')
> Out: 
> What am I missing?
Okay, I need two \\ so I'm not trying to match a backspace. I knew
(okay, hoped ;) I would figure it out once I posted the question and
More information about the Python-list