I got a string which looks like this : "(store (key 39)(index 994 995 996 997 998 999 1000 1001 1002))"
I want to add every number behind index in a listbox, but we don't know exactely how many numbers there are ( in this case it are 9 , but i got many more lines of these in which the amount varries between like 1 and 100).
So how can I make my Regex auto generate groups if neccesary ?
Last thing I tried was this (doesn't work) :
//KeyBox is just a textbox: enter Key number and it'll display all item number(indexes) in this store
Regex store = new Regex(@"\(store \(key " + KeyBox.Text + @"\)\(index ((\d+))+"); //notice the ((\d+))+ with the second + I'm trying to make more (\d+) groups if they're available
foreach (string line in content) // content is a string array in which the stores are saved
View Complete Post