Answer the question
In order to leave comments, you need to log in
How to modify the search for all occurrences of a string (re)?
Please tell me how to modify the search for all occurrences of a string:
import re
string = "'Everest Re Group, Ltd. [SPB: Акции]','IHS Markit Ltd. [МБ ФР: Т+ Акции и ДР]','Invesco Ltd. [SPB: Акции]'"
re.findall(r'\[.+\]', string)
output: ["[SPB: Акции]','IHS Markit Ltd. [МБ ФР: Т+ Акции и ДР]','Invesco Ltd. [SPB: Акции]"]
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