title: Is there a regex symbol to match one, the other, or both (if possible)?
body: <p>I want to highlight a group of words, they can appear single or in a row. I'd like them to be highlighted together if they appear one after the other, and if they don't, they should also be highlighted, like the normal behavior. For instance, if I want to highlight the words:</p>
  
  <blockquote>
    <p>results as</p>
  </blockquote>
  
  <p>And the subject is:</p>
  
  <blockquote>
    <p>real time results: shows results as you type</p>
  </blockquote>
  
  <p>I'd like the result to be:</p>
  
  <blockquote>
    <p>real time results: shows &lt;span class="highlighted"&gt; results as &lt;/span&gt; you type</p>
  </blockquote>
  
  <p>The whitespaces are also a headache, because I tried using an or expression:</p>
  
  <pre><code>( results )|( as )
  </code></pre>
  
  <p>with whitespaces to prevent highlighting words like bass, crash, and so on. But since the whitespace after results is the same as the whitespace before as, the regexp ignores it and only highlights results.</p>
  
  <p>It can be used to highlighted many words so combinations of</p>
  
  <pre><code>( (one) (two) )|( (two) (one) )|( one )|( two )
  </code></pre>
  
  <p>are not an option :(</p>
  
  <p>Then I thought that there may be an operator that worked like | that could be use to match both if possible, else one, or the other.</p>