fork download
  1. import re
  2. print(
  3. re.sub(r'#[^#]+#',
  4. r'<>\g<0></>',
  5. r'Эта строка #test# написана 19.01.2018, #x# а могла бы и 01.09.2017')
  6. )
Success #stdin #stdout 0.03s 9552KB
stdin
Standard input is empty
stdout
Эта строка <>#test#</> написана 19.01.2018,  <>#x#</> а могла бы и 01.09.2017