Open this example in the interactive library
Source code
import re
print(re.findall(r'<.*?>', '<b>hello</b>'))Sample output
['<b>', '</b>']

Use a non-greedy match. A self-contained example using the Python standard library.
Open this example in the interactive library
import re
print(re.findall(r'<.*?>', '<b>hello</b>'))['<b>', '</b>']