Complex text formatting ASP.NET/C#
<p>Accused to be not detailed enough, now I'll try to be detailed and descriptive as possible.</p>

<p>So, I have web application with textbox. Next to it I made label for preview, so when I click Submit, it sends text to remote application, when I press preview, it sends text to label for preview.</p>

<p>Remote application have specific text formatting, so When I type <code>A</code> text becomes red, <code>B</code>, text becomes green, and so on. When I wan't to change color, I type this sign for new color, I can't close color (like in HTML).
For new line, I also have a sign, it's @r
I also have sign for double width.</p>

<p>Main problem is to do following things:</p>

<ol>
<li>Count characters and spaces, and break line on last space before 30th sign (replace space with @r (new row sign), so space wouldn't be taken to next row).
None of the @x(x is some letter) should be counted, as they just do text formatting.</li>
<li>While counting characters, when it comes to %Y (sign for double letter's width), it should count double those letters and spaces until it comes to @Z or @W, where normal letters with starts again, and from that point, count again one by one letter.</li>
</ol>

<p>If anything is not clear enough, please ask.</p>
