Reputation: 982
Is there any regular expression to match this:
?
Examples:
Upvotes: 0
Views: 280
Reputation: 13099
Maybe you can try this:
>>> message = "blabla df qdsf dqsf \"fqdfdqsfsdf fdqs fqdsf\""
>>> pattern = "(\w+|'.*[^']'|\".*[^\"]\")"
>>> re.findall(pattern, message)
['blabla', 'df', 'qdsf', 'dqsf', '"fqdfdqsfsdf fdqs fqdsf"']
Upvotes: 0