作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的输入样本是:
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 15">
<meta name=Originator content="Microsoft Word 15">
<link rel=File-List href="detailedFoot_files/filelist.xml">
我想做的是选择整个 html 标签并将其替换为某些内容。所以我使用正则表达式
<html.*>
如果我以 Mather.DOTALL 方式使用此正则表达式,则整个文本输入将被替换。
我不知道该怎么做。任何形式的帮助将不胜感激。
最佳答案
关于java - java中使用正则表达式匹配多行文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37770963/
我是一名优秀的程序员,十分优秀!