Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
This is the input:
XML
<ul>
    <li>ONE</li>
    <li>TWO</li>
    <li>THREE</li>
</ul>  

<ol>
    <li>ONE</li>
    <li>TWO</li>
    <li>THREE</li>
    
</ol> 

I want this output using Regular Expressions and c#

• ONE
• TWO
• THREE

1. ONE
2. TWO
3. THREE



Please help me....


Thanks in advance
Posted
Updated 4-Jan-11 20:29pm
v3
Comments
JF2015 5-Jan-11 2:22am    
Fixed formatting.

1 solution

Regular expression isn't there to help you in such a situation.

Whatever your HTML tag is will give you finally out put in a browser in a pattern of what you wanted actually, What you want to achieve using Regex.

Dot is a HTML display for unordered li tags.
and number is a HTML display for ordered li tags.

If you want to remove HTML tag and want to attach number in front of text.
then use THIS[^] my tip that will remove HTML tags and use that regex to replace with your need in specific pattern.
 
Share this answer
 
Comments
venkatrao palepu 5-Jan-11 4:33am    
This is working fine for single line, But i want in three lines..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900