title: Test String Against Multiple Regex Expressions
body: <p>Similar to <a href="https://stackoverflow.com/questions/22252297/match-a-string-against-multiple-regex-patterns">this</a> question, I have an element that I'd like to test if it matches with a certain regex pattern. Currently, I'm doing something like this:</p>
  
  <pre><code>direction-type/words[matches(., '^cresc') or
              matches(., '^decresc') or matches(., '^diminuendo')]
  </code></pre>
  
  <p>However, now I'd like to add many more elements to this and make those elements easier to edit, perhaps by placing them all in a variable. I'd ideally like to do something like in <a href="https://stackoverflow.com/a/10533209/1482644">this</a> solution, where you don't have to add a 'or' between each individual regex case:</p>
  
  <pre><code>&lt;xsl:if test="contains('|ab|bc|ca|', concat('|', $var, '|'))"&gt;
  </code></pre>
  
  <p>How would I make something like that work with regex?</p>