Java RegEx Replace all to format data from XML

Good afternoon all, I've noticed they're a few similar problems on here already but non have been of much help to me so far. I am trying to manipulate a String returned by and existing method to format it in to a readable form. So for example I am trying to creates a String replaceAll() regular expression which will take the string \[code\]"<ds:AddressLine1>Birkmire Farm</ds:AddressLine1><ds:AddressLine2>Some Village</ds:AddressLine2><ds:AddressLine3>Wigfield</ds:AddressLine3><ds:AddressLine4>Cumbria</ds:AddressLine4><ds:UKpostcode>CA9 1EJ</ds:UKpostcode>"\[/code\]and convert it to...\[code\]Birkmire Farm, Some Village, Wigfield, Cumbria, CA9 1EJ\[/code\]The way I envisaged doing this was in three steps, firstly to replace all the closing tags with "", then to replace all the opening tags with ", " and finally use the String replaceFirst to remove the first comma and space placed at the front of the string.The issue I am having is the RegEx I need to formulate a pattern to identify any opening tag ie and a pattern to identify any closing tag ie . Any help on this would be greatly appreciated.
 
Back
Top