I am trying to parse through some text from an unstructured legal document to extract it in a pre-defined csv readable format.
I am working with regular expressions and would need some help with the following piece of text piece:
`text0 = “”“Guideline 9: Sectoral guideline for retail banks
9.1. For the purpose of these guidelines, retail banking means the provision of banking services
to natural persons and small and medium-sized enterprises. Examples of retail banking
products and services include current accounts, mortgages, savings accounts, consumer and
term loans, and credit lines.
Guideline 10: haha this is a test”""
Section_re = r’(\Guideline+) (\d+:) (.*)'
matches_group1 = re.findall(Section_re, text0, re.IGNORECASE)
My goal is to search for all text patterns that have:
- “Guideline XY: Text”
but receive the error message :
if len(escape) == 2: 401 if c in ASCIILETTERS: --> 402 raise source.error("bad escape %s" % escape, len(escape)) 403 return LITERAL, ord(escape) 404 except ValueError: error: bad escape \G at position 1
I would be so grateful for any type of help!!
Ps: I work in Jupyter notebook