title: Slim 3 Configure specific regex into route
body: <p>I have a regex: <code>^(profile\/\~)(:\([0-9a-z,-]+\))?$</code> this allows strings like: <code>profile/~</code> or <code>profile/~:(var1,var2,var3,...)</code></p>
  
  <p>I need to configure this regex into a Slim route for accept the following routes.</p>
  
  <pre><code>http://example.com/v1/profile/~:(var1, var2)
  http://example.com/v1/profile/~:
  </code></pre>
  
  <p>My PHP code:</p>
  
  <pre><code>$app = new \Slim\App;
  $app-&gt;group('/v1', function () {
      $this-&gt;get('/profile/~[:[{fields:[0-9a-z,-]+}]]', function ($request, $response, $args) {
          $name = $request-&gt;getAttribute('name');
          $response-&gt;getBody()-&gt;write("Hello " . $args['fields']);
          return $response;
      })-&gt;setName('profile');
  });
  $app-&gt;run();
  </code></pre>
  
  <p>Is there any way to convert that regex to one compatible with slim?</p>