tiousiforver
New Member
I'd like to remove all the attributes from my XML structure. My choice is regex but if there's a simpler way, I'm wide open for suggestions.To pick out a single, fix tag I used the following.\[code\]String clean = Regex.Replace(filled, ".*?<holder[^>]*?>(.*?)</holder>.*?", "$1");\[/code\]That gives me the contents of the tag holder. I'd like now to keep the text mass but omit all the attributes in the inside tags. I've tried the following approach.\[code\]String plain1 = Regex.Replace(clean, "(<[^>]*?>)(.*?)(</[^>]*?>)", "$1$2$3");String plain2 = Regex.Replace(clean, "(<[a-zA-Z]*?)([^>]*?)(>)", "$1$3");\[/code\]But it gives me just the same stuff back (plain1) and just empty tags with no original names (plain2). Nothing is getting cleaned up or everything is. What do I do wrong?I've noticed that changing start for plus, gives me tags that contain only the first letter of the names, so I'm pretty sure that the following is the right way to go as long as I can make the picked up section for $1 maximally large. How do I do that?\[code\]String plain3 = Regex.Replace(clean, "(<[a-zA-Z]+?)([^>]*?)(>)", "$1$3");\[/code\]