title: How to stop matching if the condition is satisfied?
body: <p>Target is to remove patterns (split by '/') with single alphabet, AND if one such pattern appears, then remove the rest right parts.
  For example:</p>
  
  <pre><code>/modadisi/v/list -&gt; /modadisi
  /i/m/videos/tnt  -&gt; null
  </code></pre>
  
  <p>New examples:</p>
  
  <pre><code>    /abcd/abcd/abcd/a/abcd -&gt; /abcd/abcd/abcd
      /abcd -&gt; /abcd 
      /abcd/abcd/abcd -&gt; /abcd/abcd/abcd
  </code></pre>
  
  <p>The current regex I use is </p>
  
  <pre><code>\/[a-zA-Z]{2,}
  </code></pre>
  
  <p>This will match all patterns, like <code>/modadisi/v/list-&gt; /modadisi/list</code>. Is it possible to modify the regex to scan from left to right, and stop if condition is matched?</p>