Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Java in General
Replacing Span Tag in String with empty string ?
Satyajit Bhadange
Ranch Hand
Posts: 104
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
html = html.replaceAll("\\<span.*?\\>.*?\\<\\/span\\>", "");
I am using above regex to replace span tag in
String
, but its not working for me. Can i get some help ?
Thank You
Thanks
user101
Problems And Solutions - Algorithms
Ray Thibeault
Greenhorn
Posts: 3
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Do you have an example of a string to be processed?
I used your regex in the following case and it works:
String html = "<html><span>hello</span>World</html>"; html = html.replaceAll("\\<span.*?\\>.*?\\<\\/span\\>", ""); System.out.println(html);
The result (as expected) is:
<html>World</html>
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
no registration
highlight pieces of text
Highlighting HTML string that spans tags
CSS not working in Firefox, works in IE
Ajax and ActionClass
More...