To look through data, I am using regular expressions. One of my regular expressions is (they are dynamic and change based on what the computer needs to look for --- using them to search through data for a game AI):

```
O,2,([0-9],?){0,},X

```

After the 2, there can (and most likely will) be other numbers, each followed by a comma.

To my understanding, this will match:

```
O,2,(any amount of numbers - can be 0 in total, each followed by a comma),X

```

This is fine, and works (in RegExr) for:

```
O,4,1,8,6,7,9,5,3,X
X,6,3,7,5,9,4,1,8,2,T
O,2,9,6,7,11,8,X # matches this
O,4,6,9,3,1,7,5,O
X,6,9,3,5,1,7,4,8,O
X,3,2,7,1,9,4,6,X
X,9,2,6,8,5,3,1,X

```

My issue is that I need to match all the numbers after the original, provided number. So, I want to match (in the example) `9,6,7,11,8`.

However, implementing this in Python:

```
import re
pattern = re.compile("O,2,([0-9],?){0,},X")
matches = pattern.findall(s) # s is the above string

```

`matches` is `['8']`, the last number, but I need to match all of the numbers after the given (so `'9,6,7,11,8'`).

Note: I need to use `pattern.findall` because thee will be more than one match (I shortened my list of strings, but there are actually around 20 thousand strings), and I need to find the shortest one (as this would be the shortest way for the AI to win).

Is there a way to match the entire string (or just the last numbers after those I provided)?

Thanks in advance!