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)
Asked By: Freddy Go

||

Answers:

If u just want the ID(1307090) you can use:

x.split("app/")[1].split('/')[0]
Answered By: Hansanho
re.search(r'app/(d+)/', link).group(1)
Answered By: roeen30
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.