code: def tmpl_deldupchars(text, chars=r'-_\.'):
          
          import re
          return re.sub(r'([' + chars + r'])\1*', r'\1', text)
docs: * synopsis: ``%deldupchars{text,chars}``
          * description: Search for duplicate characters and replace with only \
              one occurrance of this characters.