- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个如下所示的文件
<title>1 INDICATIONS AND USAGE</title>
<text>
<paragraph>Therapy with lipid-altering agents should be only one component of multiple risk factor intervention in individuals at significantly increased risk for atherosclerotic vascular disease due to hypercholesterolemia. Drug therapy is recommended as an adjunct to diet when the response to a diet restricted in saturated fat and cholesterol and other nonpharmacologic measures alone has been inadequate. In patients with CHD or multiple risk factors for CHD, LIPITOR can be started simultaneously with diet.</paragraph>
</text>
<effectiveTime value="20170630"/>
<excerpt>
<highlight>
<text>
<paragraph>LIPITOR is an HMG-CoA reductase inhibitor indicated as an adjunct therapy to diet to:</paragraph>
<list listType="unordered" styleCode="disc"> <item>Reduce the risk of MI, stroke, revascularization procedures, and angina in adult patients without CHD, but with multiple risk factors (<linkHtml href="#S1.1">1.1</linkHtml>).</item>
<item>Reduce the risk of MI and stroke in adult patients with type 2 diabetes without CHD, but with multiple risk factors (<linkHtml href="#S1.1">1.1</linkHtml>).</item>
<item>Reduce the risk of non-fatal MI, fatal and non-fatal stroke, revascularization procedures, hospitalization for CHF, and angina in adult patients with CHD (<linkHtml href="#S1.1">1.1</linkHtml>).</item>
<item>Reduce elevated total-C, LDL-C, apo B, and TG levels and increase HDL-C in adult patients with primary hyperlipidemia (heterozygous familial and nonfamilial) and mixed dyslipidemia (<linkHtml href="#S1.2">1.2</linkHtml>).</item>
<item> Reduce elevated TG in adult patients with hypertriglyceridemia and primary dysbetalipoproteinemia (<linkHtml href="#S1.2">1.2</linkHtml>).</item>
<item>Reduce total-C and LDL-C in patients with homozygous familial hypercholesterolemia (HoFH) (<linkHtml href="#S1.2">1.2</linkHtml>).</item>
<item>Reduce elevated total-C, LDL-C, and apo B levels in pediatric patients, 10 years to 17 years of age, with heterozygous familial hypercholesterolemia (HeFH) after failing an adequate trial of diet therapy (<linkHtml href="#S1.2">1.2</linkHtml>).</item>
</list>
<paragraph><content styleCode="underline">Limitations of Use</content>:</paragraph>
<paragraph>LIPITOR has not been studied in <content styleCode="italics">Fredrickson </content>Types I and V dyslipidemias (<linkHtml href="#S1.3">1.3</linkHtml>).</paragraph>
</text>
</highlight>
</excerpt>
<component>
<section ID="S1.1">
<id root="3a10e3ca-e81c-43c9-9262-e15f334eedfc"/>
<code code="42229-5" codeSystem="2.16.840.1.113883.6.1" displayName="SPL UNCLASSIFIED SECTION"/>
<title>1.1 Prevention of Cardiovascular Disease in Adults</title>
<text>
<paragraph>In adult patients without clinically evident coronary heart disease, but with multiple risk factors for coronary heart disease such as age, smoking, hypertension, low HDL-C, or a family history of early coronary heart disease, LIPITOR is indicated to:</paragraph>
<list listType="unordered" styleCode="disc">
<item>Reduce the risk of myocardial infarction</item>
<item>Reduce the risk of stroke</item>
<item>Reduce the risk for revascularization procedures and angina</item>
</list>
<paragraph>In adult patients with type 2 diabetes, and without clinically evident coronary heart disease, but with multiple risk factors for coronary heart disease such as retinopathy, albuminuria, smoking, or hypertension, LIPITOR is indicated to:</paragraph>
<list listType="unordered" styleCode="disc"> <item>Reduce the risk of myocardial infarction</item>
<item>Reduce the risk of stroke</item>
</list>
<paragraph>In adult patients with clinically evident coronary heart disease, LIPITOR is indicated to:</paragraph>
<list listType="unordered" styleCode="disc">
<item>Reduce the risk of non-fatal myocardial infarction</item>
<item>Reduce the risk of fatal and non-fatal stroke</item>
<item>Reduce the risk for revascularization procedures</item>
<item>Reduce the risk of hospitalization for CHF</item>
<item>Reduce the risk of angina</item>
</list>
</text>
<effectiveTime value="20170630"/>
</section>
</component>
<component>
<section ID="S1.2">
<id root="d9003937-e6d4-453b-a767-40f6077a351a"/>
<code code="42229-5" codeSystem="2.16.840.1.113883.6.1" displayName="SPL UNCLASSIFIED SECTION"/>
<title>1.2 Hyperlipidemia</title>
<text>
<paragraph>LIPITOR is indicated:</paragraph>
<list listType="unordered" styleCode="square"> <item>As an adjunct to diet to reduce elevated total-C, LDL-C, apo B, and TG levels and to increase HDL-C in adult patients with primary hypercholesterolemia (heterozygous familial and nonfamilial) and mixed dyslipidemia (<content styleCode="italics">Fredrickson </content>Types IIa and IIb);</item>
<item>As an adjunct to diet for the treatment of adult patients with elevated serum TG levels (<content styleCode="italics">Fredrickson </content>Type IV);</item>
<item>For the treatment of adult patients with primary dysbetalipoproteinemia (<content styleCode="italics">Fredrickson </content>Type III) who do not respond adequately to diet;</item>
<item>To reduce total-C and LDL-C in patients with homozygous familial hypercholesterolemia (HoFH) as an adjunct to other lipid-lowering treatments (e.g., LDL apheresis) or if such treatments are unavailable;</item>
<item>As an adjunct to diet to reduce total-C, LDL-C, and apo B levels in pediatric patients, 10 years to 17 years of age, with heterozygous familial hypercholesterolemia (HeFH) if after an adequate trial of diet therapy the following findings are present:<list listType="ordered" styleCode="LittleAlpha"> <item>LDL-C remains ≥ 190 mg/dL or</item> <item>LDL-C remains ≥ 160 mg/dL and:<list listType="unordered" styleCode="disc"> <item>there is a positive family history of premature cardiovascular disease or</item> <item>two or more other CVD risk factors are present in the pediatric patient</item> </list> </item> </list> </item>
</list>
</text>
<effectiveTime value="20170630"/>
</section>
</component>
<component>
<section ID="S1.3">
<id root="b9d715d4-0a9e-4ada-9fd8-574fd627290a"/>
<code code="42229-5" codeSystem="2.16.840.1.113883.6.1" displayName="SPL UNCLASSIFIED SECTION"/>
<title>1.3 Limitations of Use</title>
<text>
<paragraph>LIPITOR has not been studied in conditions where the major lipoprotein abnormality is elevation of chylomicrons (<content styleCode="italics">Fredrickson </content>Types I and V).</paragraph>
</text>
<effectiveTime value="20170630"/>
</section>
</component>
</section>
</component>
<component>
<section ID="S2">
<id root="be8db708-c4d3-4fba-934c-6e372b862de6"/>
<code code="34068-7"
我想解析文件并获取标签之间的所有文本。
所以我编写了一段代码,其中显示“>”和“之间的子字符串”
如何获取整个文件中的所有标签?
代码
try {
File file = new File("A:/OneDrive - PharmaCompany, Inc/Diksha Work/usage1.txt");
FileReader fileReader = new FileReader(file);
BufferedReader bufferedReader = new BufferedReader(fileReader);
StringBuffer stringBuffer = new StringBuffer();
String line,l;
while ((line = bufferedReader.readLine()) != null) {
int start =(line.indexOf(">"));
int end=(line.indexOf("</"));
String name = line.substring(start+1,end);
System.out.println(name);
}
fileReader.close();
} catch (IOException e) {
e.printStackTrace();
}
我只获取前两个标签之间的文本:
实际输出
1 INDICATIONS AND USAGE
预期输出
1 INDICATIONS AND USAGE Therapy with lipid-altering agents should be only one component of multiple risk factor intervention in individuals at significantly increased risk for atherosclerotic vascular disease due to hypercholesterolemia. Drug therapy is recommended as an adjunct to diet when the response to a diet restricted in saturated fat and cholesterol and other nonpharmacologic measures alone has been inadequate. In patients with CHD or multiple risk factors for CHD, LIPITOR can be started simultaneously with diet. LIPITOR is an HMG-CoA reductase inhibitor indicated as an adjunct therapy to diet to: ... (and so on all the text between the tags till the end of the file)
最佳答案
为了从文本文件中提取 > 和 < 字符之间的所有非零长度文本,您可以使用正则表达式 ">([^>|^<]{1,})<"。
String text= "fljjl;<xmlelement>value</xmlelement> <jjjj> <tag>kkk< ><'l'l'";
final Matcher matcher = Pattern.compile(">([^>|^<]{1,})<").matcher(text);
while(matcher.find()) {
System.out.println(matcher.group(1));
}
例如,上面的代码将从文本字符串中提取“value”和“kkk”。
关于java - 获取文件中两个字符之间的所有子字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50861606/
我需要您在以下方面提供帮助。近一个月来,我一直在阅读有关任务和异步的内容。 我想尝试在一个简单的 wep api 项目中实现我新获得的知识。我有以下方法,并且它们都按预期工作: public Htt
我的可执行 jar 中有一个模板文件 (.xls)。不需要在运行时我需要为这个文件创建 100 多个副本(稍后将唯一地附加)。用于获取 jar 文件中的资源 (template.xls)。我正在使用
我在查看网站的模型代码时对原型(prototype)有疑问。我知道这对 Javascript 中的继承很有用。 在这个例子中... define([], function () { "use
影响我性能的前三项操作是: 获取滚动条 获取偏移高度 Ext.getStyle 为了解释我的应用程序中发生了什么:我有一个网格,其中有一列在每个单元格中呈现网格。当我几乎对网格的内容做任何事情时,它运
我正在使用以下函数来获取 URL 参数。 function gup(name, url) { name = name.replace(/[\[]/, '\\\[').replace(/[\]]/,
我最近一直在使用 sysctl 来做很多事情,现在我使用 HW_MACHINE_ARCH 变量。我正在使用以下代码。请注意,当我尝试获取其他变量 HW_MACHINE 时,此代码可以完美运行。我还认为
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 关闭 9 年前。 要求提供代码的问题必须表现出对所解决问题的最低限度的理解。包括尝试过的解决方案、为什么
由于使用 main-bower-files 作为使用 Gulp 的编译任务的一部分,我无法使用 node_modules 中的 webpack 来require 模块code> dir 因为我会弄乱当
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 5 年前。 Improve this qu
我使用 Gridlayout 在一行中放置 4 个元素。首先,我有一个 JPanel,一切正常。对于行数变大并且我必须能够向下滚动的情况,我对其进行了一些更改。现在我的 JPanel 上添加了一个 J
由于以下原因,我想将 VolumeId 的值保存在变量中: #!/usr/bin/env python import boto3 import json import argparse import
我正在将 MSAL 版本 1.x 更新为 MSAL-browser 的 Angular 。所以我正在尝试从版本 1.x 迁移到 2.X.I 能够成功替换代码并且工作正常。但是我遇到了 acquireT
我知道有很多关于此的问题,例如 Getting daily averages with pandas和 How get monthly mean in pandas using groupby但我遇到
This is the query string that I am receiving in URL. Output url: /demo/analysis/test?startDate=Sat+
我正在尝试使用 javascript 中的以下代码访问 Geoserver 层 var gkvrtWmsSource =new ol.source.ImageWMS({ u
API 需要一个包含授权代码的 header 。这就是我到目前为止所拥有的: var fullUrl = 'https://api.ecobee.com/1/thermostat?json=\{"s
如何获取文件中的最后一个字符,如果是某个字符,则删除它而不将整个文件加载到内存中? 这就是我目前所拥有的。 using (var fileStream = new FileStream("file.t
我是这个社区的新手,想出了我的第一个问题。 我正在使用 JSP,我成功地创建了 JSP-Sites,它正在使用jsp:setParameter 和 jsp:getParameter 具有单个字符串。
在回答 StoreStore reordering happens when compiling C++ for x86 @Peter Cordes 写过 For Acquire/Release se
我有一个函数,我们将其命名为 X1,它返回变量 Y。该函数在操作 .on("focusout", X1) 中使用。如何获取变量Y?执行.on后X1的结果? 最佳答案 您可以更改 Y 的范围以使其位于函
我是一名优秀的程序员,十分优秀!