-1

I am trying regular expression in php for url pattern matches url which doesnt start with "/api/v1".

^(?!/api/v1.*$).* 

isn't working for me.

I am trying to configure it in symfony security config to match url patter for symfony security firewall

main:
    pattern: '^(?!/api/v1.*$).*'
vishal
  • 3,643
  • 11
  • 51
  • 96

1 Answers1

-1

When I ran your expression through regexr.com it said ERROR: Unescaped forward slash. This may cause issues if copying/pasting this expression into code.

Adding a backslash before each of your forward slashes removed the error. Give this a try ^(?!\/api\/v1.*$).*