fork(3) download
  1. #!/bin/bash
  2. s="There is stuff here (word, number, phrases) , even more :) with smilies. The quick, (brown, fox) jumps over, the (lazy, old, dog)"
  3. echo $s | sed '/(/ {:a s/\(([^,()]*\),/\1:/; t a}'
  4. echo $s | sed '{:a;s/\(([^,()]*\),/\1:/;ta}'
  5. echo $s | sed -E '{:a;s/(\([^,()]*),/\1:/;ta}'
  6.  
Success #stdin #stdout 0s 19632KB
stdin
Standard input is empty
stdout
There is stuff here (word: number: phrases) , even more :) with smilies. The quick, (brown: fox) jumps over, the (lazy: old: dog)
There is stuff here (word: number: phrases) , even more :) with smilies. The quick, (brown: fox) jumps over, the (lazy: old: dog)
There is stuff here (word: number: phrases) , even more :) with smilies. The quick, (brown: fox) jumps over, the (lazy: old: dog)