I need to replace some text in a db field based on a regex search on a string.
So far, I have this:
foo = my_string.gsub(/\[0-9\]/, "replacement" + array[#] + "text")
So, I'm searching in the field for each instance of a number surrounded by brackets ([1],[2],etc.). What I would like to do is find each number (within the brackets) in the search, and have that number used to find the specific array node.
Any ideas? Let me know if anyone needs any kind of clarification.