I have a regex to strip the end off a request url:
re.sub('(?:^\/en\/category).*(-\d{1,4}$)', '', r)
My problem is that the docs say it will replace the matched part, however when it matches my string it replaces the whole string, e.g.:
/en/category/specials/men-2610
I'm not sure what Python is doing, but my regex seems fine
EDIT: I wish to have the string with the end stripped off, target =
/en/category/specials/men