In RegEx, I want to find the tag and everything between two XML tags, like the following:
this can capture most outermost layer pair of tags, even with attribute in side or without end tags
().)*-->|<\w*((?!\/<).)*\/>|<(?\w+)[^>]*>(?>[^<]|(?R))*<\/\k\s*>)
edit: as mentioned in comment above, regex is always not enough to parse xml, trying to modify the regex to fit more situation only makes it longer but still useless