fork download
  1. #!/bin/bash
  2. s='(888) 747-7424'
  3. sed -E 's/^(([^0-9]*[0-9]){2}[^0-9]*)([0-9])(([^0-9]*[0-9]){4}[^0-9]*)([0-9])/\1\6\4\3/' <<< "$s"
Success #stdin #stdout 0s 4544KB
stdin
Standard input is empty
stdout
(884) 747-7824