James Smith wrote: > 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()
>>> pattern = re.compile("(\d+)$") >>> match = pattern.search( "LINE: 235 : Primary Shelf Number (attempt 1): 1") >>> match.group() '1' See <https://docs.python.org/dev/library/re.html#search-vs-match> -- https://mail.python.org/mailman/listinfo/python-list