A🍊
Size: a a a
A🍊
SZ
💭П
A🍊
💭П
A🍊
💭П
in
A🍊
in
KK
import re
urlpath_regex = r'^([^\/]*(?:\/\/)?[^?\/=]+\/?(?:[^?\/=]+\/?)*)(?:\?[^?\/]+)*$'
def get_path(url):
try:
return re.match(urlpath_regex, str(url).lower()).group(1).rstrip('/')
except AttributeError:
return None
print(
get_path('http://example.ru/page1/page2?z=5&x=7') == get_path('http://ExampLe.ru/page1/page2/')
)
KK
KK
D