Skip to content

Instantly share code, notes, and snippets.

@jroo
Created February 22, 2009 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jroo/68573 to your computer and use it in GitHub Desktop.
Save jroo/68573 to your computer and use it in GitHub Desktop.
extract CRS report order codes from string and return as list
import re
#extract CRS report order codes from string and return as list
def extract_ordercodes(haystack):
p = re.compile('R\d{5}|RL\d{5}|RS\d{5}|IB\d{5}')
needle_list = p.findall(haystack)
return needle_list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment