Skip to content

Instantly share code, notes, and snippets.

View jroo's full-sized avatar

jroo jroo

View GitHub Profile
@jroo
jroo / extract_laws.py
Created February 22, 2009 19:05
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