Hello,
I have an xml file all on one line. I would like to separate all tags on separte lines. I am having problems creating the proper regex to grab the shortest pattern. Here is my example file:
<a>who cares</a><b>not me</b>
my script:
gsub(/<\/(.*)?>/, "n")
outfile:
<a>who caresn
Conclusion:
The regex is grabbing the longest possible string rather than the shortest. I thought my syntax for non-greedy pattern matching was correct, but apparently not.
Any assistance would be appreciated.
Thanks
I have an xml file all on one line. I would like to separate all tags on separte lines. I am having problems creating the proper regex to grab the shortest pattern. Here is my example file:
<a>who cares</a><b>not me</b>
my script:
gsub(/<\/(.*)?>/, "n")
outfile:
<a>who caresn
Conclusion:
The regex is grabbing the longest possible string rather than the shortest. I thought my syntax for non-greedy pattern matching was correct, but apparently not.
Any assistance would be appreciated.
Thanks