title: understanding regex if then statements
body: <p>So I'm not sure if I understand how this works and would like
  <strong><code>a simple explanation to how they work</code></strong> is all. I probably have it way off. <strong><code>A pure regex solution is required, and I don't know if this is possible</code></strong>. If it is, a solution would be awesome too, but a shove in the right direction would be good for my learning process <code>^_^</code></p>
  
  <p>This is how I thought the <code>if/then/else</code> option built into my regex engines was formatted:</p>
  
  <pre><code>?(condition)if regex|else regex
  </code></pre>
  
  <p>I want it to capture a string from a very specific location only when this string exists within a certain section of javascript. Because this is how I thought it worked after a decent amount of research I tried out a few variations of this code but they all ended up something like this.</p>
  
  <pre><code>((?^view_large$)Tables-137(.*?)search.htm)
  </code></pre>
  
  <p><strong><code>Also of relevance: I'm using an java based app that has regex searches which pull the data I need so I cannot write an if statement in java which would be my preferred method.</code></strong> It's a pain to have to do it this way, but at the moment I have no other choice. I'm trying really hard for them to allow java code functionality instead of pure regex for more versatile options.</p>
  
  <p>So to summarize, <strong><code>is there even a if/then option in regex and if so how is it formatted for what I'm trying to accomplish?</code></strong></p>
  
  <p><strong>EDIT: The string that I want to be the "if condition" is like this: if <code>view_large</code> string exists and is not null then capture the exact string <code>500/</code> which is captured within the catch all group I used: <code>(.*?)</code></strong></p>