Im trying to match a URL's path (window.location.pathname) but exclude anything further down the path.
I want to match the following:
- /admin/sites/{2-6 digit number}{/ exclude the rest}
Examples
/admin/sites/123 - true
/admin/sites/1 - false
/admin/sites/123/foo - false
I've got as far as the following regex but can't seem to figure out the rest.
/admin\/sites\/[0-9]/.test(window.location.pathname)