title: Remove Class from DIV found using partial match
body: <p>I have a div with a class which I need to switch out based on what the user is interacting with.</p>
  
  <pre><code>&lt;div class="book-chapter-name chapter2" data-lhg="chapter-info"&gt;
      &lt;span&gt;Chapter String Here&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I have the current div in a jQuery object and this has been found using:</p>
  
  <pre><code>$('div[class*="chapter"]')
  </code></pre>
  
  <p>What I want to do is remove the existing class and insert a new class so that <code>chapter2</code> becomes <code>chapter3</code> </p>
  
  <pre><code>var chapterString = $('#page'+page).attr('data-lhg-chapter'),
      chapterNumber = $('#page'+page).attr('data-lhg-chapter-number'),
      chapterInfo = $('[data-lhg="chapter-info"]');
  
  if($('div[class*="chapter"]')){
      $('div[class*="chapter"]').removeClass('chapter[0-9]');
  }
  
  $(chapterInfo).text(chapterString).addClass('chapter'+chapterNumber);
  </code></pre>
  
  <p>This doesn't seem to work, I think it is to do with the string passed to <code>removeClass</code> but I am not sure what to put in there to get the right result.</p>