Skip to content

Instantly share code, notes, and snippets.

@jroo
Created February 22, 2009 19:05
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/68570 to your computer and use it in GitHub Desktop.
Save jroo/68570 to your computer and use it in GitHub Desktop.
return list of U.S. public law numbers extracted from string
import re
# return list of public law numbers extracted from string
def extract_laws(haystack):
p = re.compile('P\.L\.\s?\d{1,3}-\d{1,3}')
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