fork download
  1. import re
  2. a = "[ruby(空,ruby=そら)]は[ruby(青,ruby=あお)]い。"
  3. print( re.sub(r'\[ruby\(([^(),]*),[^()]*\)]', r'\1', a) )
Success #stdin #stdout 0.02s 9744KB
stdin
Standard input is empty
stdout
空は青い。