title: Regular Expression: PATTERN with exception using AWK gsub
body: <p>I have a data file (cou.data)</p>
  
  <pre><code>USSR    8649    275 Asia
  Cananda 3852    25  North America
  China   3705    1032    Asia
  USA 3615    237 North America
  Brazil  3286    134 South America
  India   1267    746 Asia
  Mexico  762 78  North America
  France  211 55  Europe
  Japan   144 120 Asia
  Germany 96  61  Europe
  England 94  56  Europe
  Taiwan  55  144 Asia
  North Korea 44  2134    Asia
  </code></pre>
  
  <p>There are only spaces but no tabs in this data.</p>
  
  <p>I want to replace all space(s) with ":", but leave country names with space unchanged.</p>
  
  <p>That is, my desired output should look like the following:</p>
  
  <pre><code>USSR:8649:275:Asia
  Cananda:3852:25:North America
  China:3705:1032:Asia
  USA:3615:237:North America
  Brazil:3286:134:South America
  India:1267:746:Asia
  Mexico:762:78:North America
  France:211:55:Europe
  Japan:144:120:Asia
  Germany:96:61:Europe
  England:94:56:Europe
  Taiwan:55:144:Asia
  North Korea:44:2134:Asia
  </code></pre>
  
  <p>I have cudgeled my brain and can only write this</p>
  
  <pre><code>awk '{ gsub(/([a-zA-Z] +[0-9]|[0-9] +[a-zA-Z]|[0-9] +[0-9])/, ":"); print }' cou.data
  </code></pre>
  
  <p>But the output is not right.</p>
  
  <pre><code>USS:64:7:sia
  Canand:85::orth America
  Chin:70:03:sia
  US:61:3:orth America
  Brazi:28:3:outh America
  Indi:26:4:sia
  Mexic:6::orth America
  Franc:1::urope
  Japa:4:2:sia
  German:::urope
  Englan:::urope
  Taiwa::4:sia
  North Kore::13:sia
  </code></pre>
  
  <p>Some parts which should not have been removed are gone. </p>
  
  <p>How can my AWK code be modified or is there an easy solution to get what I want ?</p>
  
  <p>ps </p>
  
  <p><code>awk '{ print gensub(/([a-zA-Z])( )([a-zA-Z])/, "\\1~\\3", "g", $0) }' cou.data | sed -r 's/ +/:/g; s/~/ /g'</code></p>