title: Using regex to make menu item active in laravel adminlte
body: <p><strong>2021:</strong> <em>This was in fact an issue with the package. Regex link matching has since been implemented with the solution I created to solve it for myself. You can read about it in the documentation <a href="https://github.com/jeroennoten/Laravel-AdminLTE/wiki/Menu-Configuration#the-active-attribute" rel="nofollow noreferrer">here</a>.</em></p>
  <hr />
  <p>I'm using Laravel 5.8 with <a href="https://github.com/jeroennoten/Laravel-AdminLTE" rel="nofollow noreferrer">AdminLTE for Laravel</a>.</p>
  <p>There's several options to create a menu, one of which is to create it in the provided config file, which I use.</p>
  <p>You can specify an <code>active</code> key in the menu that allows you to make the menu have the class that makes the menu item active and activates the dropdown.</p>
  <p>I have a menu item, which I would like to make active on these pages:</p>
  <ul>
  <li>/posts (works with <code>active =&gt; ['/posts']</code>)</li>
  <li>/posts/{post_id} (id are only numbers)</li>
  </ul>
  <p>These URL's shouldn't match:</p>
  <ul>
  <li>/posts/create</li>
  <li>/posts/anyotherlink</li>
  <li>/posts/1text</li>
  </ul>
  <p>I can not use <code>/posts/*</code> because that would make the create page and some others active.</p>
  <p><a href="https://github.com/jeroennoten/Laravel-AdminLTE#active-menu-items" rel="nofollow noreferrer">The readme</a> suggest that you can also use regex to do this. I don't use regex at all, but I came to this, which, according tot <a href="https://regex101.com/r/xeseaH/1" rel="nofollow noreferrer">regex101</a> seems to match what I need it to:</p>
  <pre><code>^\/posts\/[0-9]+$
  </code></pre>
  <p>I've tried to implement it like so:</p>
  <pre><code>[
      'text'    =&gt; 'Posts overview',
      'url'     =&gt; '/posts',
      'icon'    =&gt; 'list',
      'active'  =&gt; ['/posts', '^\/posts\/[0-9]+$'],
      'active'  =&gt; ['/posts', '/posts/[^0-9]'] // also tried this
  ],
  </code></pre>
  <p>Unfortunately, this does not seem to work as it doesn't make the menu item active on the pages listed above.</p>
  <p><strong>Edit:</strong> I've also created an issue in the GitHub repository as I suspect that this might be an issue with the package.</p>
  <p>Am I missing something, or doing something wrong?</p>