Reputation: 10387
I'd like to match
/.well-known/*
Except
/.well-known/apple-app-site-association
I've tried a few things around
\/\.well-known\/^(?!apple-app-site-association).*
but they don't match strings like
/.well-known/123/erg3rg
/.well-known/
:
var reg = new RegExp(/\/\.well-known\/^(?!apple-app-site-association).*/)
"/.well-known/apple-app-site-association".match(reg) // null :)
"/.well-known/123".match(reg) // null :(
Upvotes: 0
Views: 102
Reputation: 1162
This should work.
\/\.well-known\/(?!apple-app-site-association).*
I just removed the ^.
Upvotes: 1
Reputation: 5271
You're on the right track, but you have an extraneous ^
. It should be:
\/\.well-known\/(?!apple-app-site-association)
The caret is to match the beginning of the text, so it will never match in the middle of your regex.
Note: the .*
at the end was also extraneous, since it would match all the same with or without it.
Upvotes: 3