String :
The car has <ex id=\"3\"/><g id=\"4\">attributes</g><g id=\"5\">, such as weight and color
using the Regex : (<.*?>)
i was able to get the tags like <ex id=\"3\"/> and <g id=\"4\">
but how can we remove all the string part from the sentence so that the final string would look like <ex id=\"3\"/><g id=\"4\"></g><g id=\"5\">
with only the tags.
Q: Remove anything from the sentence but tags (NOT operator for tags).
Matcher.find()and get your new string usingmatcher.group(0)