<p>Looking for a bit of regex help.
I'd like to design an expression that matches a string with "<em>foo</em>" OR "<em>bar</em>", but not both "<em>foo</em>" AND "<em>bar</em>"</p>

<p>If I do something like...</p>

<pre><code>/((foo)|(bar))/
</code></pre>

<p>It'll match "<em>foobar</em>". Not what I'm looking for. So, how can I make regex match only when one term or the other is present?</p>

<p>Thanks!</p>

You can do this with a single regex but I suggest for the sake of readability you do something like...
```
```
(/foo/ and not /bar/) || (/bar/ and not /foo/)
```
```