(?i) means do not match case. Replace all uppercase and lowercase letters. html = html.replaceAll("(<(?i)(|)[^]*/?>)|( )|(')|(\")", ""); System.out.println(html); (<(?i)(|)[^]*/?>)|( )|(')|(\") -- matches all tags, spaces, and quotes. If you only want to replace a part, make the following changes (<(?i)(|)[^]*/?>) --Replace all tags (<(?i)(p|img)[^]*/?>) -- replace p and img tags (<(?i)a[^]*/?>) --Replace only the a tag |
<<: How to handle spaces in CSS
>>: Modify the style of HTML body in JS
Scenario: When page A opens page B, after operati...
Table of contents Preface InnoDB storage architec...
Description of the situation: Today, I logged int...
There was an article about the execution process ...
1. Same IP address, different port numbers Virtua...
tomcat is an open source web server. The web base...
How to set up a MySQL short link 1. Check the mys...
To install a virtual machine on a Windows system,...
Introduction to jQuery The jQuery library can be ...
This article example shares the specific code of ...
Table of contents background What is the Metavers...
I had been using MySQL 5.7 before, but because My...
Table of contents What is Flattening recursion to...
First of all, let's talk about the execution ...
The result (full code at the bottom): The impleme...