My problem is that Python, using regex and re.search() doesn't recognize accents even though I use utf-8. Here is my string of code;
#! /usr/bin/python
-*- coding: utf-8 -*-
import re
htmlString = '</dd><dt> Fine, thank you. </dt><dd> Molt bé, gràcies.'
SearchStr = '(\<\/dd\>\<dt\>)+ ([\w+\,\.\s]+)([\&\#\d\;]+)(\<\/dt\>\<dd\>)+ (\w+) (\w+)'
Result = re.search(SearchStr, htmlString)
if Result:
print Result.groups()
passavol23:jO$ catalanword.py
('</dd><dt>', 'Fine, thank you.', ' ', '</dt><dd>', 'Molt', 'b')
So the problem is that it doesn't recognizes the é and thus stops. Any help would be appreciated. Im a Python beginner.