For example, if a long article containing html tags obtains 400 characters of text, the filter conditions are as follows: hyperlink, & amp; lt; code & amp; gt; tag, bold label and italic label. The remaining labels only contain plain text. Delete linefeeds and img tags. Replace two or more spaces with one .... For example, if a long article containing html tags obtains 400 characters of text, the filter conditions are as follows:
Hyperlink
,
Tag
,Bold labels
,Italic label
.
The remaining labels only contain plain text.
Delete linefeeds and img tags. Replace two or more spaces with one.
Within 400 characters, if
, Bold, italic labels are not closed to filter the remaining content.
If the hyperlink is not closed within 400 characters, wait until the hyperlink is closed.
Many examples found online do not match. So I asked a question on sf. Do not delete the problem. Hope competent programmers can help. Reply content:For example, if a long article containing html tags obtains 400 characters of text, the filter conditions are as follows:Hyperlink
,Tag
,Bold labels
,Italic label
.
The remaining labels only contain plain text.
Delete linefeeds and img tags. Replace two or more spaces with one.
Within 400 characters, if
, Bold, italic labels are not closed to filter the remaining content.
If the hyperlink is not closed within 400 characters, wait until the hyperlink is closed.
Many examples found online do not match. So I asked a question on sf. Do not delete the problem. Hope competent programmers can help.
In the visual test, you need to replace the regular expression based on the matching conditions.
We recommend that you first read the regular expression tutorial and split the requirement into multiple steps.
Update:
In addition to string processing, it can also be understood as DOM processing. It is more appropriate to use JavaScript to process DOM.
I have used the simple_html_dom library before and can operate html like jquery. I hope it will be useful to you.