Python 2.7.1 I am trying to use python regular expression to extract words inside of a pattern
I have some string that looks like this
someline abc s
You want a capture group.
p = re.compile("name (.*) is valid", re.flags) # parentheses for capture groups print p.match(s).groups() # This gives you a tuple of your matches.