(?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
This article example shares the specific code of ...
I recently came into contact with MySQL. Yesterda...
Mysql supports 3 types of lock structures Table-l...
Several concepts Line box: A box that wraps an in...
need Recently, we need to migrate Node online ser...
Table of contents 1. Paradigm foundation 1.1 The ...
MyISAM storage engine The MyISAM storage engine i...
1. MYSQL installation directory Copy the code as ...
Open the connection tool. I use MobaXterm_Persona...
There is a new feature that requires capturing a ...
1. unlink function For hard links, unlink is used...
Table of contents Load Balancing Load balancing c...
Click here to return to the 123WORDPRESS.COM HTML ...
This article introduces how to configure Nginx to...
Today I will share with you a breathing carousel ...