Here's on that takes arguments: import sys
import re
import json
singleLinePatterns = [
r'(Product name)[,]+(.*?),',
r'(Product number)[,]+(.*?),',
r'(Internal identification)[,]+(.*?),',
r'(Identified uses)[,]+(.*?),',
r'(Contains)[,]+(.*?)$'
]
singleLineMatchers = [re.compile(p) for p in singleLinePatterns]
multiLinePatterns = [
r'Physical hazards',
r'Health hazards',
r'Environmental hazards',
r'Hazard statements',
r'Precautionary statements',
r'Supplemental label information'
]
multiLineMatchers = [re.compile(p) for p in multiLinePatterns]