I am trying to use regex to get the number of the ID that occurs closest to the name "Daily". With this I'm experiencing difficulties though. When I try regex patterns I get either the following results:
- Everything from the first ID occurrence until "Daily" is selected.
- All the ID's are individually selected (I could specify the Match Number to get the correct ID then, but the problem is that it won't match any more if an ID is added or removed before the one I need).
- No matches are found.
I have been trying regexr to test my regex.
In the link is also an example of the text where I'm trying to get my results from. I didn't include the whole text as that would be too much information. With the current regex pattern there I could select Match Number 3 to get the result I need, but the problem is that ID's could be added or removed between the desired result.
Another pattern that I used is }},{.*?"id":([0-9]*).*?Daily
and that pattern results in the correct ID, but the problem is that I also need to get the ID for the part with name "9am" and for others too. Changing "Daily" in that pattern to "9am" returns ID of "Daily" instead of the one for "9am".
I have tried so many different options, but none of them look for exactly what I want, expect for the one where I need to specify the Match Number when I just let the regex match all "id":([0-9]*) patterns.
Does anyone know how I can properly get the desired result?