How can I get some characters from an url, using regular expressions for example:
How can I get the characters aaaa and 123456789 that are before and after /posts/ ?
import re
url = "https://www.facebook.com/aaaaaa/posts/123456789/sdd"
out = re.match('.+/(.+)/posts/(.+)/', url).groups()
print(out)
# Output:
('aaaaaa', '123456789')