I am wanting to verify and then parse this string (in quotes):
string = \"start: c12354, c3456, 34526; other stuff that I don\'t care about\" //Note that som
import re sstr = re.compile(r'start:([^;]*);') slst = re.compile(r'(?:c?)(\d+)') mystr = "start: c12354, c3456, 34526; other stuff that I don't care about" match = re.match(sstr, mystr) if match: res = re.findall(slst, match.group(0))
results in
['12354', '3456', '34526']