fork download
  1. import re
  2.  
  3. content = ("[\n"
  4. " 1,\n"
  5. " 2, \n"
  6. " true\n"
  7. " ]")
  8.  
  9. print(re.sub(r'(\[\n[ ]+\d+, ?\n[ ]+)\d+(, ?\n[ ]+(?:true|false)\n[ ]+\])', r'\1__table1.column__\2', content))
  10.  
Success #stdin #stdout 0.03s 9636KB
stdin
Standard input is empty
stdout
[
 1,
 __table1.column__, 
 true
 ]