fork(1) download
  1. input = " aa asdf hello world
  2. aabf adnbfsgn
  3. asdf
  4. ";
  5. input.gsub!(/(?:^ {2})|\G {2}/m,"x")
  6. puts input
  7.  
Success #stdin #stdout 0s 4760KB
stdin
Standard input is empty
stdout
xaa   asdf        hello world
aabf    adnbfsgn
x asdf