Run code block only to specific pathname type

Run code block only to specific pathname type

I am writing a userscript I have a working code block I want to run ONLY on pages that match the following address:

https://www.example.org/administrator/products/1971/edit

where 1971 can be any number 

I assume I need to do a regEx expression.

e.g. window.location.href.match(/(.*)(\/\d*)/)[1]

I apologise that this is a general js question. I tend to get abuse on stackoverflow so I avoid it, love jQuery and any jQuery based solution would be welcome.