title: Regular expression to match a character only once before any whitespace
body: <p>In Java, what regular expression would I use to match a string that has exactly one colon and makes sure that the colon appears before any whitespace?</p>
  
  <p>For example, it should match these strings:</p>
  
  <pre><code>label: print "Enter input"
  But: I still had the money.
  ghjkdhfjkgjhalergfyujhrageyjdfghbg:
  area:54
  </code></pre>
  
  <p>But not</p>
  
  <pre><code>label: print "Enter input:"
  There was one more thing: I still had the money.
  ghfdsjhgakjsdhfkjdsagfjkhadsjkhflgadsjklfglsd
  area::54
  </code></pre>