Answer the question
In order to leave comments, you need to log in
How to insert a line with spec. characters in a regular expression?
There is a need to dynamically create regular expressions to search for substrings with different headers, it looks something like this:
event_bc = re.search(r'NA={};.+?BC=(.+?);'.format(event_title), category_block)
spec_symbs = ('(', ')')
for sym in spec_symbs:
event_title = event_title.replace(sym, f'\\{sym}')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question