Simple regex task: find an ID (and language) within a string.
import re
txt = '<OB02 ID="1099367" LANG="FR">'
pattern = r'\\ID="(.*?)\\"'
result = re.findall(pattern, txt)
This gives an empty list as result. Leading to the questions:
- How to correctly encapsulate \" in python?
- How to extract ID and LANG from txt?