title: Regular Expression to find all occurrences of a word within a lookaround expression
body: <p>I need to find all occurrences of "st" within any class declaration on any html page like this for example:</p>
  
  <pre><code>class="st0 st1 st2", class="st3 st45", class="st678"
  </code></pre>
  
  <p>I say within a class declararion because there may be other occurrences of "st" throughout the document and I do not want to change every occurrence.</p>
  
  <p>My ultimate goal here is a find and replace. I have the logic written out for that but I just need to figure out how to isolate "st" from the string.</p>
  
  <p>I have experimented with a few different lookaround expressions but I cannot seem to match every occurrence. Below are a few examples of what I have been trying.</p>
  
  <p><strong>This expression gets everything between 'class="' and '"':</strong></p>
  
  <p>Regular Expression:</p>
  
  <pre><code>(?&lt;=class=").*(?=")
  </code></pre>
  
  <p>Test sting:</p>
  
  <pre><code>class="st10 st11"
  </code></pre>
  
  <p>Matching result :</p>
  
  <pre><code>"st10 st11"
  </code></pre>
  
  <p><strong>Here is another one I tried:</strong></p>
  
  <p>Regular Expression:</p>
  
  <pre><code>(?&lt;=class=")((st)\d*\s*)*(?=")
  </code></pre>
  
  <p>Test sting:</p>
  
  <pre><code>class="st10 st11"
  </code></pre>
  
  <p>Matching result:</p>
  
  <pre><code>"st10 st11"
  </code></pre>
  
  <p>Matching groups:</p>
  
  <ol>
  <li>st11</li>
  <li>st</li>
  </ol>
  
  <p>I have been testing my regular expression here at <a href="http://rubular.com" rel="nofollow">Rubular.com</a></p>
  
  <p><sub>added from comments</sub><br>
  I am going to be using the regular expression within a terminal shell command which I will run on a specific folder. The shell command will do a find and replace on every file that is in the folder like this...</p>
  
  <pre><code>perl -pi -w -e 's/st/stx/g;' ~/Desktop/svg_find_replace/*.svg.
  </code></pre>
  
  <p>Any help would be much appreciated.</p>