title: Is it possible to set the final value of a capture group?
body: <p>I have a very specific use case where a system is using REs to extract data and in this case I would prefer to not return the matched value but an arbitrary value. This would be more convenient than updating the underlying software.</p>
  
  <p>I was wondering if this was achievable by somehow setting the value of a capture group without affecting the matching behavior. I thought maybe something like a "constant" callout that would do something like an <code>(?(*ACCEPT))</code> and return whatever it is passed as text.</p>
  
  <p>If group <code>1</code> matches, then return <code>OK</code> else <code>NOT OK</code>: </p>
  
  <pre><code>(.*)(?(1)(?CC"OK")|(?CC"NOT OK"))
  </code></pre>
  
  <p><em>(<code>CC</code> is the magic I need)</em></p>
  
  <p>I've been reading <a href="http://www.pcre.org/original/doc/html/pcrepattern.html" rel="nofollow noreferrer">this</a> and <a href="http://www.pcre.org/current/doc/html/pcre2syntax.html" rel="nofollow noreferrer">this</a> but haven't found anything of the sort.</p>