title: Zend2 routes constraints like enum
body: <p>I want to have a enum like constraint on a variable passed to of my project's route</p>
  
  <p>e.g. variable <code>routeVar</code> only can be <strong>optin</strong> or <strong>optout</strong></p>
  
  <p>so lets say I want to have a url like http://subdomain.exampledomain.com/route/ which can get only one of the two following forms </p>
  
  <ol>
  <li>http://subdomain.exampledomain.com/route/<strong>optin</strong></li>
  <li>http://subdomain.exampledomain.com/route/<strong>optout</strong></li>
  </ol>
  
  <p>the route configuration I've put together is as shown bellow and I have tried both <code>[optin|optout]</code> and <code>[optin|optout]+</code> regexes but no luck </p>
  
  <pre><code>'route-name' =&gt; [
      'type' =&gt; 'Segment',
      'options' =&gt; [
          'route' =&gt; '/route/:routeVar',
          'constraints' =&gt; [
              'routeVar' =&gt; '[optin|optout]',
          ],
          'defaults' =&gt; [
              'controller' =&gt; someController::class,
              'action' =&gt; 'someAction',
          ],
      ],
      'may_terminate' =&gt; true,
  ],
  </code></pre>
  
  <p>please note: this is a child route and it works fine to address the expected controller and action. I only fail to apply the the limitation I described using the  constraint :(</p>