G
g field
I am having trouble with a regex expression - any help would be
appreciated.
I have text files that need to be converted to XML. Most of it works
fine. However, there is one glitch. One section of the text file
looks like this:
Dealer Installed Accessories:
All-weather floor mats
Cargo net
(Note: there could be any number of Accessories listed)
I search for this pattern using:
Dealer.*Accessories: *(\r\n){0,3}(.*) *\r\n*
Or,
Dealer.*Accessories *(\r\n){0,3}(.*) *\r\n*).*?
My replace text is <option>$2</option>
The result is always: <option>All-weather floor mats</option>Cargo net
The desired result is <option>All-weather floor
mats</option><option>Cargo net</option>
(Of course, that pattern will need to repeat for all the Accessories
listed in the file).
Any thoughts on how to tweak the regex expression to accommodate this?
appreciated.
I have text files that need to be converted to XML. Most of it works
fine. However, there is one glitch. One section of the text file
looks like this:
Dealer Installed Accessories:
All-weather floor mats
Cargo net
(Note: there could be any number of Accessories listed)
I search for this pattern using:
Dealer.*Accessories: *(\r\n){0,3}(.*) *\r\n*
Or,
Dealer.*Accessories *(\r\n){0,3}(.*) *\r\n*).*?
My replace text is <option>$2</option>
The result is always: <option>All-weather floor mats</option>Cargo net
The desired result is <option>All-weather floor
mats</option><option>Cargo net</option>
(Of course, that pattern will need to repeat for all the Accessories
listed in the file).
Any thoughts on how to tweak the regex expression to accommodate this?