English 中文(简体)
我需要把没有关键词的插图与任意立场相匹配。
原标题:I need to match strings that don t contain a keyword at an arbitrary position

我需要将以下几句相匹配:don t包含一个关键词(beta2)。

考虑:

var aStr    = [
                 /beta1/foo ,
                 beta1/foo ,
                 /beta1_xyz/foo ,
                 blahBlah/beta1/foo ,
                 beta1 ,

                 /beta2/foo ,
                 beta2/foo ,
                 /beta2_xyz/foo ,
                 blahBlah/beta2/foo ,
                 beta2 ,

                 /beat2/foo ,
                 beat2/foo ,
                 /beat2_xyz/foo ,
                 blahBlah/beat2/foo ,
                 beat2 
            ];

function bTestForMatch (Str)
{
    return /.*(?!beta2).*/i.test (Str);
}

for (var J=0, iLen=aStr.length;  J < iLen;  J++)
{
    console.log (J, bTestForMatch (aStr[J]), aStr[J]);
}

我们需要一种与排除<条码>>2<<>>>>>>>>>>/代码”的所有指示相匹配的法规。 它可以在扼杀中担任各种职务。

预期成果是:

 0    true    /beta1/foo
 1    true    beta1/foo
 2    true    /beta1_xyz/foo
 3    true    blahBlah/beta1/foo
 4    true    beta1
 5    false   /beta2/foo
 6    false   beta2/foo
 7    false   /beta2_xyz/foo
 8    false   blahBlah/beta2/foo
 9    false   beta2
10    true    /beat2/foo
11    true    beat2/foo
12    true    /beat2_xyz/foo
13    true    blahBlah/beat2/foo
14    true    beat2

reg是用于3级分析工具,该工具使用 Java的固定表述来过滤次结果。 该工具只使用一条线。 没有人反对,我们就没有使用其源码。

是否有将过滤第二贝塔结果的Java regex(beta) 这一分析的结果如何?

最佳回答

提 出

/^(?!.*beta2).*$/
问题回答

这是否被视为欺骗?

return !/beta2/i.test (Str);




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签