我有一个特定的项目,我需要将每个代码行包装为65个字符.我为此正确设置了eclipse Java代码格式化程序.但我真正想要的是在编辑器中绘制的垂直线,显示我在键入时的最大线宽,而不仅仅是在我运行formmater时.我知道此功能在某些容量中可用,因为它显示在代码格式化程序属性页中.
我在eclipse中没有看到任何选项来打开它,我没有看到任何插件在Eclipse插件中心上执行此操作
页眉,页脚和侧栏具有固定位置。中间的内容区域带有两个滚动条。浏览器上没有外部滚动条。我有一个可以在IE7和FF中使用的布局。我需要添加IE6支持。我该如何进行这项工作?
这是我当前CSS的近似值。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Layout</title>
<style>
* {
margin: 0px;
padding: 0px;
border: 0px;
}
.sample-border {
border: 1px solid black;
}
#header {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
height: 60px;
}
#left-sidebar {
position: absolute;
top: 65px;
left: 0px;
width: 220px;
bottom: 110px;
}
#right-sidebar {
position: absolute;
top: 65px;
right: 0px;
width: 200px;
bottom: 110px;
}
#footer {
position: absolute;
bottom: 0px;
left: 0px;
right: 0px;
height: …
Run Code Online (Sandbox Code Playgroud) 鉴于以下XML代码段,我需要获取DataElements下每个子项的名称/值对列表.XPath或XML解析器不能用于我无法控制的原因,因此我正在使用正则表达式.
<?xml version="1.0"?>
<StandardDataObject xmlns="myns">
<DataElements>
<EmpStatus>2.0</EmpStatus>
<Expenditure>95465.00</Expenditure>
<StaffType>11.A</StaffType>
<Industry>13</Industry>
</DataElements>
<InteractionElements>
<TargetCenter>92f4-MPA</TargetCenter>
<Trace>7.19879</Trace>
</InteractionElements>
</StandardDataObject>
Run Code Online (Sandbox Code Playgroud)
我需要的输出是:[{EmpStatus:2.0},{支出:95465.00},{StaffType:11.A},{Industry:13}]
DataElements下的标记名称是动态的,因此无法在正则表达式中按字面表示.标签名称TargetCenter和Trace是静态的,可以在正则表达式中,但如果有办法避免硬编码,那将是更好的选择.
"<([A-Za-z0-9]+?)>([A-Za-z0-9.]*?)</"
Run Code Online (Sandbox Code Playgroud)
这是我构造的正则表达式,它的问题是它在结果中错误地包含{Trace:719879}.依赖于XML中的换行或任何其他明显的格式不是一种选择.
下面是我正在使用的Java代码的近似值:
private static final Pattern PATTERN_1 = Pattern.compile(..REGEX..);
private List<DataElement> listDataElements(CharSequence cs) {
List<DataElement> list = new ArrayList<DataElement>();
Matcher matcher = PATTERN_1.matcher(cs);
while (matcher.find()) {
list.add(new DataElement(matcher.group(1), matcher.group(2)));
}
return list;
}
Run Code Online (Sandbox Code Playgroud)
如何将我的正则表达式更改为仅包含数据元素并忽略其余部分?