title: Reading and replacing Integers in a string
body: <p>I have a string for example "x(10, 9, 8)" I want to read each integer from the string then using the integer as an array index retrieve a new integer from an array and replace it with this value.</p>
  
  <p>All of the methods I've tried seem more suited to applying the same thing to all integers, or just retrieving the integers and then loosing track of them. Can anyone tell me the best way to do this please?</p>