title: How to split a CamelCase string in its substrings in Ruby?
body: <p>I have a nice CamelCase string such as <code>ImageWideNice</code> or <code>ImageNarrowUgly</code>. Now I want to break that string in its substrings, such as <code>Image</code>, <code>Wide</code> or <code>Narrow</code>, and <code>Nice</code> or <code>Ugly</code>.</p>
  
  <p>I thought this could be solved simply by</p>
  
  <pre><code>camelCaseString =~ /(Image)((Wide)|(Narrow))((Nice)|(Ugly))/
  </code></pre>
  
  <p>But strangely, this will only fill <code>$1</code> and <code>$2</code>, but not <code>$3</code>.</p>
  
  <p>Do you have a better idea for splitting that string?</p>