I am trying to make a script that reads the list element sequentially and concatenate them each into regex pattern.
for example,
I have a list like this:
lst = ['B.', 'Article', 'III']
And want to comprise regex something like this:
re.search(r lst[0]\s+lst[1]\s+lst[2]).group()
so that it can match below regardless of white_spaces between each elements from the list:
candidate_1 = 'B. Article III'
candidate_2 = 'B. Article III'