I have a single line of xml and would like to parse all text parts into a list of text.
text = '<string name="status">Finishing <xliff:g id="number">%d</xliff:g> percent.</string>'
My desired output:
desired_output = ['Finishing', '%d', 'percent.']
I used regular expression for this simple task.
import re
pattern = re.compile(r'>.+<')
match = re.findall(pattern, text)
match = ['>Finishing <xliff:g id="number">%d</xliff:g> percent.<']
It seems regular expression failed to get my desired output.