You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by Jeff Lowery <je...@mavericklabel.com> on 2015/08/11 01:39:11 UTC

Strange behavior with regex array and any()

Something odd is happening here that I’m not able to reproduce reliably.  Here’s a summary:
	
if (it.classes().disjoint(tooltippedClasses)) {	
	def src = it.@src
	def skipIt = /* some condition equalling */ false 
	skipIt = skipIt || [/.*adroll.*/, /.*facebook.*/, /.*googleads.*/, /.*adnxs.*/].any{src ==~ it}

	if (skipIt) println "skipped $src"

	if (!skipIt) {
		missing.push(src);
	}
}

skipIt is returning false for a src = "http://ib.adnxs.com/seg?add=3xxxxx8&t=2 <http://ib.adnxs.com/seg?add=8888888&t=2>”, but only sometimes:

> skipped http://ib.adnxs.com/seg?add=3xxxxx8&t=2

Is there some side-effect I’m overlooking?  

JRE 1.8.0_25, groovy 2.4.3

— Jeff