title: REGEXP_SUBSTR Remove All Chars after the Match
body: <p>I am trying to extract Work Weeks from user comments, user comments might be like</p>
  <p>&quot;Something WW15 Target Complete&quot;</p>
  <p>&quot;WW12.3 Good to Go&quot;</p>
  <p>Currently my script is grabbing the match but also everything after it,</p>
  <p><strong>Result = WW12.3 Good to Go</strong></p>
  <p><strong>Ideal Result would be just the WW12.3 part.</strong></p>
  <p>I need to do a course and watch demos on REGEXP but thats for another day unfortunately.</p>
  <pre><code>SELECT 
    BATCH, OPERATOR, COMMENTS, TXN_DATE
   ,REGEXP_SUBSTR(COMMENTS,'WW[^;]+') as ETA
  FROM F_LOTCOMMENTHIST
  </code></pre>
  <p>I have also tried doing this to remove everything after a space but it doesnt work:</p>
  <pre><code>SELECT 
    BATCH, OPERATOR, COMMENTS, TXN_DATE
   ,REPLACE(REGEXP_SUBSTR(COMMENTS,'WW[^;]+'),' [^;]+','') as ETA
  FROM F_LOTCOMMENTHIST
  </code></pre>
  <p>I understand that I am probably using the wrong pattern string but I just cant figure out what I need when looking at example tables like:</p>
  <p><a href="https://www.techonthenet.com/oracle/functions/regexp_substr.php" rel="nofollow noreferrer">https://www.techonthenet.com/oracle/functions/regexp_substr.php</a></p>