To elaborate a little bit, I believe Paul is suggesting that if the String represents valid XML (which would necessarily include an end tag), then it would be easiest to use some sort fo XML parser. If it's not valid XML, then I guess you can use regular expressions, but the split() method probably won't help much as the delimiters are too different. I'd recommend using a
Pattern and Matcher to find the whole tag, and then another Pattern and Matcher to locate the individual attributes within the tag. This will require some knowledge of regular expressions however. And there are some complications which may not be immediately obvious. If you can use a standard XML parser, that will probably be simpler.