[ad_1]
I have the following string and I need to extract all Danger level
values.
s = “Title: Welcome message. Header: . Subheader: Multimedia system.
Description: . Danger level: Title: Goodbye message. Header: .
Subheader: Cover. Description: . Danger level: L1”
The expected result is:
['','L1']
This is my current code:
import re
result = re.search('Danger level:(.*)', s)
result.group(1)
It works only if Danger level
is mentioned once in the string s
.
How can I update this code to get the expected result?
[ad_2]