MRAB wrote: > On 2015-08-18 22:42, Laurent Pointal wrote: >> Hello, <zip> >> ellipfind_re = re.compile(r"((?=\.\.\.)|…)", re.IGNORECASE|re.VERBOSE) >> ellipfind_re.sub(' ... ', >> "C'est un essai... avec différents caractères… pour voir.")
> (?=...) is a lookahead; a non-capture group is (?:...). > > The regex should be r"((?:\.\.\.)|…)", which can be simplified to just > r"\.\.\.|…" for your use-case. (You don't need the > re.IGNORECASE|re.VERBOSE either!) Thanks, I made same mistake in another place, but dont see it here. A+ Laurent. -- https://mail.python.org/mailman/listinfo/python-list