Removing HTML tags from regular expressions in Java
The regular expression in Java removes the HTML tag, which is mainly used to display the content more accurately. For example, some time ago, it was doing the function similar to publishing an article in a blog. After entering the content in the editor, the style tag will also be transferred to the background and saved in the database. However, when displaying the summary, for example, the first 50 words of the body will be displayed as the summary, At this time, you need to remove all HTML tags and intercept 50 words. Therefore, the following method is implemented through Java regular expression. The code is as follows:
Note: This is the method of removing HTML tags from Java regular expressions@ H_ 419_ 4@
PS: the method is only for reference, for everyone to learn from each other. If there are deficiencies or questions, please comment.