java - Remove HTML tags from a String with content -


i have string = "195121<span class="up">+432</span>". need regex remove tags content (result string = "195121")

you may try below capturing group based regex.

string.replaceall("(?s)<(\\w+)\\b[^<>]*>.*?</\\1>", ""); 

Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -