import res = '/en/category/specials/men-2610'r = re.sub("(^\\/en\\/category.*)-\\d{1,4}$", "\\1", s)print(r)
Standard input is empty
/en/category/specials/men
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!