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

javascript - How to process users in one specific order using map o each function? -

java - Two interface have same method name with different return type -

javascript - Linking from page A to a specific iframe on page B -