Good day. Little question about reg exp.
I have a string look like
http://servercom/smth/Age=&Filter=2&
How can i cut &
with regexp from url?
After regexp url-string must be http://server.com/smth/Age=1&Filter=2&
Good day. Little question about reg exp.
I have a string look like
http://servercom/smth/Age=&Filter=2&
How can i cut &
with regexp from url?
After regexp url-string must be http://server.com/smth/Age=1&Filter=2&
You don't need regex for that:
changed = str.replace('&', '&');
You are translating XML escaped special characters. Use the standard lib:
>>> u = "http://servercom/smth/Age=&Filter=2&
>>> import xml.sax.saxutils
>>> xml.sax.saxutils.unescape(u)
'http://servercom/smth/Age=&Filter=2&'