小编use*_*234的帖子

Apache Pig - 具有多个匹配条件的MATCHES

我想尝试一个逻辑匹配标准,如:

(("Foo" OR "Foo Bar" OR FooBar) AND ("test" OR "testA" OR "TestB")) OR TestZ
Run Code Online (Sandbox Code Playgroud)

并将其作为匹配猪使用的文件

result = filter inputfields by text matches (some regex expression here));
Run Code Online (Sandbox Code Playgroud)

问题是我不知道如何将上面的逻辑表达式转换为匹配方法的正则表达式.

我摆弄各种各样的东西,我最接近的是这样的:

((?=.*?\bFoo\b | \bFoo Bar\b))(?=.*?\bTestZ\b)
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?如果可能的话,我还需要尝试以编程方式进行此转换.

一些例子:

a - 快速的棕色Foo跳过了懒惰测试(这应该通过,因为它包含foo和测试)

b - TestZ中发生的事情(这也包含了testZ)

c - 快速的棕色Foo跳过懒狗(这应该失败,因为它包含Foo但不测试,testA或TestB)

谢谢

java regex hadoop apache-pig

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

jquery点击事件递归

我正在尝试添加新行并在选择前一行时绑定单击事件。问题在于,这会创建一个递归逻辑,因为单击函数本身是绑定的。因此,目前第一个更新适用于点击绑定,但不适用于以下新行。这是代码

$('.new').click(function ()
                {
                   var newrow =" <div class='controls controls-row'><div id='div_id_"+this.id.split('_')[1]+'_'+new String(parseInt(this.id.split('_')[2])+1)+"' class='control-group control span1 m-wrap input-icon' >"+this.id.split('_')[1]+'_'+new String(parseInt(this.id.split('_')[2])+1)+"</div><div id='div_rules_"+this.id.split('_')[1]+'_'+new String(parseInt(this.id.split('_')[2])+1)+"' class='control-group control span5 m-wrap input-icon' ><input type='text' onchange='updateRecord(this)' id='rules_"+this.id.split('_')[1]+'_'+new String(parseInt(this.id.split('_')[2])+1)+"' name='rules_"+this.id.split('_')[1]+'_'+new String(parseInt(this.id.split('_')[2])+1)+"'  class='m-wrap span11 new' value=''/></div></div>";
                    var Parent = document.getElementById('tablediv');
                    var NewDiv = document.createElement("DIV");
                    NewDiv.innerHTML = newrow;
                    Parent.appendChild(NewDiv);
                    $('.new').click(function ()
                    {
                        var newrow =" <div class='controls controls-row'><div id='div_id_"+this.id.split('_')[1]+'_'+new String(parseInt(this.id.split('_')[2])+1)+"' class='control-group control span1 m-wrap input-icon' >"+this.id.split('_')[1]+'_'+new String(parseInt(this.id.split('_')[2])+1)+"</div><div id='div_rules_"+this.id.split('_')[1]+'_'+new String(parseInt(this.id.split('_')[2])+1)+"' class='control-group control span5 m-wrap input-icon' ><input type='text' onchange='updateRecord(this)' id='rules_"+this.id.split('_')[1]+'_'+new String(parseInt(this.id.split('_')[2])+1)+"' name='rules_"+this.id.split('_')[1]+'_'+new …
Run Code Online (Sandbox Code Playgroud)

javascript jquery onclick

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

标签 统计

apache-pig ×1

hadoop ×1

java ×1

javascript ×1

jquery ×1

onclick ×1

regex ×1