如何匹配“不”与java正则表达式模式更多的字符?(how to matching “not” with more chars in java regex pattern?)
在java正则表达式中,使用
[^x]
匹配“不”与一个字符。我想知道,如何匹配更多的字符不?
我使用
[^789]
,这是不对的。String text="aa(123)bb(456)cc(789)dd(78)"; text=text.replaceAll("\\([^789].*?\\)",""); System.out.println(text);
我想得到的结果是:
aabbcc(789)dd
如何修复我的正则表达式模式?
非常感谢 :)
in java regex,use
[^x]
to matching "not" with one char.i want to know,how to matching more chars not?
i using
[^789]
,it's not right.String text="aa(123)bb(456)cc(789)dd(78)"; text=text.replaceAll("\\([^789].*?\\)",""); System.out.println(text);
i want get result is:
aabbcc(789)dd
how to fix my regex pattern?
thanks a lot :)
原文:https://stackoverflow.com/questions/3786451
最满意答案
我按照以下步骤解决了这个问题。
- 在IDField上创建了一个组
- 将所有字段从详细信息部分移动到上面的组标题。
- 抑制了细节部分。
创建以下公式并将其放在组头中。 我已经压制了这个,因为我不必显示这个。
whileprintingrecords; numbervar totalOfIDField := totalOfIDField + {IDField}; "";
创建了一个公式来显示上面的字段(totalOfIDField)。
whileprintingrecords; numbervar taotalOfIDField;
这应该放在相应的组页脚中。
创建一个公式,以便在每次更改组时重置totalOfIDField。 包含在主组标题中。
whileprintingrecords; numbervar totalOfIDField := 0;
I followed below steps to solve this issue.
- Created a group on the IDField
- Moved all the fields from detail section to the above group header.
- Suppressed the detail section.
Created the below formula and placed it in group header. I have supressed this because I didn't have to display this.
whileprintingrecords; numbervar totalOfIDField := totalOfIDField + {IDField}; "";
Created a formula to display the above field (totalOfIDField).
whileprintingrecords; numbervar taotalOfIDField;
This should be placed in the corresponding Group Footer.
Created a formula to reset the totalOfIDField each time group changes. Included this in the Main Group Header.
whileprintingrecords; numbervar totalOfIDField := 0;
相关问答
更多-
您还需要在子代码中为代码提供数据源。 就像是: rdoc.OpenSubreport("my_awesome_subreport.rpt").SetDataSource(ds); You need to give the subreport a datasource in your code behind as well. Something like: rdoc.OpenSubreport("my_awesome_subreport.rpt").SetDataSource(ds);
-
表格子报告属性(Tabular Sub-report Property)[2021-10-18]
首先,表格报告必须至少有一个组。 尝试将属性TabularFreeze设置为切断表格区域的值。 红线必须直接位于TextBox的右侧。 表格区域将从行移动到列。 First of all, the tabular report must have at least one group. Try to set a property TabularFreeze to value that cuts off a tabular region. It is necessary that the red line w ... -
这不可能。 子数据集绑定到报表元素,该报表元素可以在报表运行时保存子数据集。 它们不提供返回值。 it is not possible. sub datasets are bound to a report element that can hold a sub dataset during report run time. They do not provide return values.
-
关联子报告组织策略(Linked Sub-report Organizing Strategy)[2024-01-21]
如果您需要为主报表中的每组数据或每个详细记录重复子报表,则子报表属于组或详细信息区域。 另一件需要考虑的事情是你的子报告是否会像“独立”报告一样有意义 - 它们是否可以存在于主报告的上下文之外? 在这种情况下,以这种方式设计它们,并在最终的主报告上使用“重新导入子报告”功能来自动获取更改。 否则它并不重要,只要你能得到你想要的布局 - 在这种情况下,只做最简单的事情。 If you need your subreports to repeat for each group of data or each d ... -
希望子报表/图形在它自己的部分? 在报告的第一部分插入新的公式(报告标题a): global booleanvar no_header := false; 在子报表部分正上方插入一个有效高度为0的新部分。 在本节中插入一个新公式: global booleanvar no_header := true; 在子报表部分插入一个新公式: global booleanvar no_header := false; 在您的页面标题条件抑制公式中输入公式: global booleanvar no_header; 您 ...
-
Crystal Reports中的子报表表示报表中的报表。 当我们想要在Crystal Reports中显示有关数据的一些其他信息时,我们使用子报表来显示详细信息。 我们在主要Crystal Reports中显示的子报表以及我们可以将其显示为On-Demand报表,这意味着我们在行中放置了一个Hyper链接,当用户单击该超链接时,将获得子报表 Subreport in Crystal Reports means a Report within a Report . When we want to show ...
-
在过去几个小时问题升级到我的同事的机器后,同事刚刚找到了解决方案:打开子报告,转到报告数据选项卡,编辑数据源,转到凭据,从“使用”切换此用户名和密码“to”提示凭据“,然后切换回来,单击”确定“按钮,切换到”预览“并查看子报告的工作情况。 这不会进行更改并且不需要保存,但它修复了VS2012可能在内部创建并在注册表或内部文件中保存的任何错误(从删除.data文件,重新启动VS或重启机器这一事实可以看出这一点不修复错误条件)。 嘘,微软! 嘘! 这是2012年与2008 BI Studio中的新错误。 Aft ...
-
如何从Crystal Report中的主报表组中减去子报表组(how to subtract Sub-Report group from main report group in Crystal Report)[2022-09-05]
您可以尝试以下方法: 为借方和贷方创建2个子报告,并在标题中逐个放置。 将所有借记值存储在数组中,将所有信用值存储在数组中,并将两者都传递给主报表。 使用下面的代码将值存储在数组中。 Shared StringVar array store; store:=store+ (Date&"-"&ToText(Value)); //append date and value to retrieve correctly in main report 1 使用不同的共享变量在两个子报表中创建相同的公式 在主要报 ... -
为了充分利用子报表,他们应该绑定到记录源(表或查询),并使用子窗体/子报表控件的Link Master Fields和Link Child Fields属性将子报表数据与父记录“同步”。 假设您有[用户]表 userID ------ Gord Tim 和[UserTraffic]表 userID trafficDate downloadMB ------ ----------- ---------- Gord 2013-04-26 366 Gord 2013-04-25 442 Ti ...
-
子报告中的重复项(Duplicates in sub-report)[2023-05-18]
我按照以下步骤解决了这个问题。 在IDField上创建了一个组 将所有字段从详细信息部分移动到上面的组标题。 抑制了细节部分。 创建以下公式并将其放在组头中。 我已经压制了这个,因为我不必显示这个。 whileprintingrecords; numbervar totalOfIDField := totalOfIDField + {IDField}; ""; 创建了一个公式来显示上面的字段(totalOfIDField)。 whileprintingrecords; numbervar ...