I need a regular Expression to get a string in between <ul> and </ul> tag...
But the thing is if there is one "<ul></ul>" tag inside the <ul> tag then regex stops with the inner  tag...But i need the entire string between the outer two  tags...
Can anyone help me?
            Asked
            
        
        
            Active
            
        
            Viewed 53 times
        
    0
            
            
        
        Vignesh Murugan
        
- 575
 - 5
 - 18
 
- 
                    2Don't try to parse arbitrarily nested HTML using regex. [It won't work](http://stackoverflow.com/a/1732454/362634). Use a proper HTML parser instead. – Marius Schulz Nov 14 '13 at 08:35
 
2 Answers
0
            Try this regex
String text = "<ul>My list</ul>";
String text1 = text.replaceAll("</?ul>", "");
                                  ^
                                  ? says / one time or none at all
                                  So it will take out <ul> and </ul>
This is java language by the way. The regex may work in different languages
        Paul Samsotha
        
- 205,037
 - 37
 - 486
 - 720
 
-1
            
            
        it will pick everything between from the first <ul> to the last </ul>.
<ul>(.*)</ul>
        Sabuj Hassan
        
- 38,281
 - 14
 - 75
 - 85