小编use*_*653的帖子

从工作记忆中检索特定类型的事实

而不是检索所有事实,我需要从工作记忆中检索特定类型的事实.

我了解到我可以从工作记忆中检索所有事实,如下所示.

drools.getWorkingMemory().getWorkingMemoryEntryPoint("Stream").getObjects();
Run Code Online (Sandbox Code Playgroud)

请提供一些指针,以从工作内存中检索特定类型的对象.

drools drools-fusion

6
推荐指数
2
解决办法
9794
查看次数

使用vba获取具有特定文本的单元格的列号

sccelhot的excel嗨我需要获取一个单元格的列,文本为ACTION.

我目前的代码如下.

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngDV As Range
Dim oldVal As String
Dim newVal As String
Dim actionColName As String
If Target.Count > 1 Then GoTo exitHandler

On Error Resume Next
Set rngDV = Cells.SpecialCells(xlCellTypeAllValidation)
On Error GoTo exitHandler

If rngDV Is Nothing Then GoTo exitHandler

If Intersect(Target, rngDV) Is Nothing Then
   'do nothing
Else
  Application.EnableEvents = False
  newVal = Target.Value
  Application.Undo
  oldVal = Target.Value
  Target.Value = newVal
  If Target.Column = 3 Then
    If …
Run Code Online (Sandbox Code Playgroud)

excel vba excel-vba

2
推荐指数
1
解决办法
3万
查看次数

关于java中的正则表达式

我有一个字符串如下.

   $x:Test( (x==5 || y==4) && ( (r==9 || t==10) && ( n>=2 || t<=4))) demo program 
Run Code Online (Sandbox Code Playgroud)

在上面的字符串中,左右拐杖的数量将根据条件而改变.

我的要求是每当我遇到最后一个右边的paranthesis然后需要连接下面的字符串.

 from "stream"
Run Code Online (Sandbox Code Playgroud)

所以结果如下.

$x:Test( (x==5 || y==4) && ( (r==9 || t==10) && ( n>=2 || t<=4))) from "stream" demo program 
Run Code Online (Sandbox Code Playgroud)

为了实现这一点,我尝试使用java中的以下代码.

Pattern pattern = Pattern.compile(".*?\\.Event\\(([^\\(]*?|\\([^\\)]*?\\))*\\)");

if(line.matches(".*\\.Test(.*).*")){
    line = pattern.matcher(line).replaceAll("$0 from  \""+"stream"+"\""+" ");                 
}
Run Code Online (Sandbox Code Playgroud)

但是如果左右限制的数量超过5,则上述代码不起作用.

需要指点来实现所需的结果我的意思是我需要任意数量的左右分支的通用解决方案.

java regex

0
推荐指数
1
解决办法
72
查看次数

标签 统计

drools ×1

drools-fusion ×1

excel ×1

excel-vba ×1

java ×1

regex ×1

vba ×1