[SOLVED] Help with regex
by fyrmest from LinuxQuestions.org on (#59NRP)
Hello.
I have a series of strings formatted like this: <row-19> in an xml document. The numbering goes from 4 up to 996.
I would like to take the string above, grab the number in it, and transform it to the following format: <row id ="19">. My problem is how to grab the number in the original strings and drop it in the new string format.
As an alternative, I could replace the <row-19> format and do away with the word row entirely, and replace it with <item id ="n"> where n is an integer that is incremented by one.
I think this is easy for someone who knows how. As always. Is anyone willing/available to help?
Thanks.


I have a series of strings formatted like this: <row-19> in an xml document. The numbering goes from 4 up to 996.
I would like to take the string above, grab the number in it, and transform it to the following format: <row id ="19">. My problem is how to grab the number in the original strings and drop it in the new string format.
As an alternative, I could replace the <row-19> format and do away with the word row entirely, and replace it with <item id ="n"> where n is an integer that is incremented by one.
I think this is easy for someone who knows how. As always. Is anyone willing/available to help?
Thanks.