1、 Replace HTML label

replaceAll("\\&[a-zA-Z]{0,9};", "").replaceAll("<[^>]*>", "\n\t")

Source code is as follows :

* String substitution
package com.you.model;
* HTML Label replacement
* @author YHD
* @version
public class StrReplace {
* @param args
public static void main(String[] args)
String str = " <table border='1' cellpadding='1' cellspacing='1'><tr><th rowspan='2'> Serial number </th><th colspan='2'> Li Si </th><th> Zhao Liu </th></tr><table>";
* Replace HTML label
String subStr = str.replaceAll("\\&[a-zA-Z]{0,9};", "").replaceAll("<[^>]*>", "\n\t");
* Print the replaced string
System.out.println(" Print the replaced string :" + subStr);

2、 The operation results are as follows

 Print the replaced string :
Serial number
Li Si
Zhao Liu 

Java replace HTML More articles on tagging methods

  1. Java replace HTML Tag method code

    This article mainly introduces Java replace HTML Tag method code , Friends in need can refer to replaceAll("\\&[a-zA-Z]{0,9};", "").r ...

  2. Java in extends And implements Usage method

    Java in extends And implements Usage method label : javaclassinterfacestring Language c 2011-04-14 14:57 33314 Human reading Comment on (7) Collection report branch ...

  3. About java Medium hashcode and equals Methods the principle

    About java Medium hashcode and equals Methods the principle 1. Introduce java Programming ideas and a lot of information will be customized javabean The requirement must be rewritten hashcode and equals Method , But it's not clear why we rewrite these two sides ...

  4. Java Medium equals and hashCode Method

    Reprinted from :Java Medium equals and hashCode Methods, Java Medium equals Methods and hashCode The method is Object Medium , So every object has these two methods , Sometimes we need to achieve specific needs , May want ...

  5. Java All kinds of ( class 、 Method 、 attribute ) Access modifiers and the description of modifiers

    class : Access modifier   Modifier  class Class name extends Parent class name implement The name of the interface ( Access modifiers are interchangeable with the location of the modifier ) Access modifier name explain remarks public It can be used by the project ...

  6. java We need to pay attention to 3 The main content /Java There are several ways to create objects in :

    1) Garbage collection 2) memory management 3) performance optimization Java There are several ways to create objects in : 1) Use new keyword , Create the corresponding object 2) adopt Class Below new Instance Create the corresponding object 3) Use I/O The stream reads the corresponding ...

  7. JAVA Medium break[ label ]continue[ label ] usage

    original text :JAVA Medium break[ label ]continue[ label ] usage Be careful :JAVA The label in must be placed before the loop , And there can't be any other statements in the middle . for example :tag:for or while or do--while; 1. Use brea ...

  8. Java Some common methods of string in

    1.Java Some common methods of string in /** * */ package com.you.model; /** * @author Administrator * @date 2014-02-24 */ ...

  9. Java Medium equals and hashCode Methods,

    Java Medium equals and hashCode Methods,   from  https://www.cnblogs.com/crazylqy/category/655181.html Reference resources :http://blog.c ...

Random recommendation

  1. delphi xe4 The solution that the program can't be debugged after adding administrator permission requirement

    Environmental Science : win7 Enterprise Edition xe4 problem : After setting the project to need administrator permission to run , Debugging will pop up a prompt box , Pictured :

  2. HDU 3461 Code Lock( Union checking set , Merge range , It's so hard to think about ideas )

    No idea at all , I didn't understand the title , Directly refer to the solution of Daniel . http://www.myexception.cn/program/723825.html It means that there is N It's a combination of two letters , Such as [wersdfj], each ...

  3. iOS Category (Category)

    iOS Category (Category) And expansion (Extension) Apple's official documents Category stay iOS It's used very often in development . Especially when expanding for system classes , We don't have to inherit system classes , Add methods directly to system classes , most ...

  4. cell The recycling of

    cell The recycling of :( Yes cell Simple optimization of ) 1. Create a logo (Identifier), It is used to distinguish different types of data in the cache pool cell. 2. Go to the cache pool and get your own cell, be used dequeueReusableCell ...

  5. Apache commons (Java Common toolkits ) brief introduction

    Apache Commons It's a very useful toolkit , Solve all kinds of practical common problems , Here's a brief list , Details visit http://jakarta.apache.org/commons/index.html Be ...

  6. UVA 12075 - Counting Triangles( The inclusion exclusion principle counts )

    Topic link :12075 - Counting Triangles The question : seek n * m In rectangle , You can make up a few triangles at most This question sums up UVA 1393 similar , Subtract three collinear points from the total situation , So the problem turns into the case of finding three points collinear , Yes ...

  7. lr11 Chinese garbled in recording script

      Before recording the script , Open the recording options configuration dialog box Record-Options, Enter into Advanced label , Check first “Support charset”, Then select support in UTF-8. stay IIS Find Web.Config writing ...

  8. Nginx Reverse proxy -- The pit along the way reprints

    For personal learning https://www.cnblogs.com/xjbBill/p/7477825.html I just came to work in the new company the other day , There are many projects in the company , It's just that the projects are developed by the team of a third party company , Now our company ...

  9. FreeSWITCH voicemail

    Function description : When extension does not exist , Voice message . step : 1. compile mod_voicemail modular . The default is compiled 2. load mod_voicemail modular : fs_cli  -->  reload mo ...

  10. to servlet Class to add source code

    1. Hold down ctrl Key not put . Click the left mouse button HttpServlet. 2. open  https://mvnrepository.com/ Download what you need jar package , To download the tape -sources Suffix 3. Click the button to attach the source code ...