The following code extracts all tags in the given string
Example
import re rex = re.compile(r'[\<\>]') l = "this is text1 <a href='irawati.com' target='_blank'>hi</a> this is text2" print rex.findall(l)
Output
['<', '>', '<', '>']
The following code extracts all tags in the given string
import re rex = re.compile(r'[\<\>]') l = "this is text1 <a href='irawati.com' target='_blank'>hi</a> this is text2" print rex.findall(l)
['<', '>', '<', '>']