Using Regex To Change Format Of C# String

I’ve been looking to find a way to programmatically change the format of text tags using Regular Expressions. For example, consider this input:

{color=red} {size=3em} Color {/color} {/size} {color=blue} {size=25}
Text {/size} (color) {/color}

I’d like to use regexes to the input becomes this:

<color=red> <size=3em> Color <color=blue> <size=25>
Text (color)

What I’ve tried so far is a bit… complicated. It’d take an essay to explain ^^ So, I’d like help on how to go about this in a way that lets me customize the output format. Like, what if I later want the tags to be in staple brackets instead of angle brackets?

Read more here: Source link