fork download
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import re
  4.  
  5. s = u'The quic k brown fox jumps over the lazy dog.'
  6. s = s.replace(u'\xa0', u' ')
  7. pattern = re.compile(ur'\sk\s')
  8. s = pattern.sub(u'k ', s)
  9. print s
Success #stdin #stdout 0.01s 8968KB
stdin
Standard input is empty
stdout
The quick brown fox jumps over the lazy dog.