I have a list of urls which have varying numbers in the end after an & sign. I'm not able to apply a regex to remove these numbers (including the &) from the url as there are multiple & in the string and the re.sub('&\d*',"",x) command filters all of the & including the one I want to remove.
The url is: http://helloworld.com?p1=123&p2=987&hello=world&123456
The desired output I want is: http://helloworld.com?p1=123&p2=987&hello=world
http://not back slashes.