title: RegEx for capturing a word in between = and ;
body: <p>I want to select <code>word2</code> from the following :</p>
  
  <pre><code>word2;word3
  </code></pre>
  
  <p><code>word2</code> that is between <code>;</code> and start of the line unless there is a <code>=</code> in between. In that case, I want start from the <code>=</code> instead of the start of the line
  like <code>word2</code> from </p>
  
  <pre><code>word1=word2;word3
  </code></pre>
  
  <p>I have tried using this regex </p>
  
  <pre><code>(?&lt;=\=|^).*?(?=;)
  </code></pre>
  
  <p>which select the <code>word2</code> from</p>
  
  <pre><code>word2;word3
  </code></pre>
  
  <p>but also the whole <code>word1=word2</code> from</p>
  
  <pre><code>word1=word2;word3
  </code></pre>