Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #78825

help with regex

Newsgroups comp.lang.python
Date 2014-10-07 21:25 -0700
Message-ID <d68610fc-b22b-4dbe-994d-177b28932347@googlegroups.com> (permalink)
Subject help with regex
From James Smith <bjlockie@lockie.ca>

Show all headers | View raw


I want the last "1"
I can't this to work:

>>> pattern=re.compile( "(\d+)$" )
>>> match=pattern.match( "LINE: 235 : Primary Shelf Number (attempt 1): 1")
>>> print match.group()

Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

help with regex James Smith <bjlockie@lockie.ca> - 2014-10-07 21:25 -0700
  Re: help with regex Peter Otten <__peter__@web.de> - 2014-10-08 08:38 +0200
  Re: help with regex Ben Finney <ben+python@benfinney.id.au> - 2014-10-08 18:42 +1100

csiph-web