Google-sheets – How to modify REGEXEXTRACT to import total hours played on Steam

google sheetsregexextract

My problem is similar as the one answered here: How to create an auto updating Google spreadsheet with information from Steam?

Only I need to modify the REGEXEXTRACTs to find total hours played instead of hours played last 2 weeks for Counter-strike

As a example I will use my own profile here http://steamcommunity.com/profiles/76561197964409756/games/

from which the most relevant part of the script is

"name":"Counter-Strike:
Global
Offensive","last_played":1489175820,"hours":"15.5","hours_forever":"3,780","friendlyURL":"CSGO",

So I am trying to get hours_forever which is in this example is 3780.

Best Answer

You can use this regex:

=REGEXEXTRACT(A1,"hours_forever"":""([\d,]+)"",")

the \d and , inside the [] brackets means it will only extract either a digit or a comma

enter image description here