How to get a certain part of a text in python?
Question:
I want to extract game id from a steam link "https://store.steampowered.com/app/1307090/Barro_Racing/?snr=1_7_7_230_150_1"
after the app/
part. I tried the following, but it didn’t work:
match = re.findall(r'app/ + /', oyunlink, flags=re.IGNORECASE)
Answers:
If u just want the ID(1307090) you can use:
x.split("app/")[1].split('/')[0]
re.search(r'app/(d+)/', link).group(1)
I want to extract game id from a steam link "https://store.steampowered.com/app/1307090/Barro_Racing/?snr=1_7_7_230_150_1"
after the app/
part. I tried the following, but it didn’t work:
match = re.findall(r'app/ + /', oyunlink, flags=re.IGNORECASE)
If u just want the ID(1307090) you can use:
x.split("app/")[1].split('/')[0]
re.search(r'app/(d+)/', link).group(1)