fork download
  1. import re
  2. a = 'hello.mate(how.are.you). And another string(here.too)'
  3. content_in_brackets = re.findall(r'\((.*)\)', a)
  4. for con in content_in_brackets:
  5. a = a.replace(con, con.replace('.', '|DOT|'))
  6. print(a)
Success #stdin #stdout 0.02s 27712KB
stdin
Standard input is empty
stdout
hello.mate(how|DOT|are|DOT|you)|DOT| And another string(here|DOT|too)