title: Visual studio find & replace with regex, replace space with underscore
body: <p>I have a large list of text in c# that in want to use as an enum list.
  For example:</p>
  
  <pre><code>Zone Status Message
  Zones Snapshot Message
  Partition Status Message
  Partitions Snapshot Message
  Supported transition message flags
  System Status Message
  X-10 Message Received
  Log Event Message
  Keypad Message Received
  </code></pre>
  
  <p>Now I want to use the find and replace dialog in visual studio to add underscores in all the words instead of a space, 
  for example</p>
  
  <pre><code>Zone_Status_Message
  Zones_Snapshot_Message
  </code></pre>
  
  <p>How can I achieve this using regex or wildcard? 
  This would really save me a lot of time.</p>
  
  <p>Thanks in advance.</p>
  
  <p>EDIT:<br>
  The words can also have spaces and the front and back, due to a poorly formatted source document where I get the text from. So the underscore should only be added when the space is between 2 words.</p>