All pastes #172572 Raw Edit

Anonymous

public python v1 · immutable
·published 2006-09-16 05:42 UTC
rendered paste body
allRegexps = (  ('plantRegex',   re.compile('^(Plant:)(.*)')),    ('kernelRegex',  re.compile('^(Kernel:)(.*)')),  ('updateRegex',  re.compile('^(Update:)(.*)')),  ('archRegex',    re.compile('^(Architecture:)(.*)')),  ('providesRegex',re.compile('^(Provides:)(.*)')),  ('dependsRegex', re.compile('^(Dependes:)(.*)')),  ('filesRegex',   re.compile('^(Files:)(.*)')),)  for line in plantData:    tab = line.strip()    if tab == "" and plant != 0:        continue    for name, regex in allRegexps:      m = regex.match(tab)      if m:        print "found " + name        # do something with m.group()        break    # and so on ...