def highlight_pseudo(paragraph): """ Hghlight pseudonymized text for Dash tool """ index = 0 new_str = [] for change in re.finditer('(.*?)', paragraph): b = change.start(0) e = change.end(0) new_str.append(paragraph[index:b]) new_str.append(html.Mark(change.group(1), style={'color': 'blue'})) index = e new_str.append(paragraph[index:]) return html.P(new_str)