I am trying to implement a function to split a sentence with XML tags in 3 parts. To be more clear, I want to parse a sentence with XML tags so that I will not have the wrapping tags.
Sorry, I don't understand how this matches up with the examples you gave, in particular why '<d id="43">text here</d>' gets split but the other <d> tags don't. I suspect this is an XY Problem, so perhaps you could explain why you want to split them in the peculiar way, and how you plan on using these split up values. I have a suspicion that a solution that splits up all the tags (optionally reassembling them later) will be easier for you.
In any case, do not use regular expressions to parse XML/HTML.
In reply to Re: Getting start and end xml tags
by haukex
in thread Getting start and end xml tags
by corfuitl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |