API  0.9.7
 All Classes Files Functions Variables Macros Groups Pages
CPComparisonPredicate.j File Reference

Go to the source code of this file.

Variables

var CPComparisonPredicateModifier
 
var CPPredicateOperatorType
 
var dest = ['.*','.?','\\(','\\)','\\{','\\}','\\.','\\+','\\|','\\/','\\$','\\^']
 
String prototype escapeForRegExp
 
var source = ['*','?','(',')','{','}','.','+','|','/','$','^']
 

Variable Documentation

var CPComparisonPredicateModifier

Definition at line 28 of file CPComparisonPredicate.j.

var CPPredicateOperatorType

Definition at line 28 of file CPComparisonPredicate.j.

var dest = ['.*','.?','\\(','\\)','\\{','\\}','\\.','\\+','\\|','\\/','\\$','\\^']

Definition at line 426 of file CPComparisonPredicate.j.

String prototype escapeForRegExp
Initial value:
= function()
{
var foundChar = false,
i = 0;
for (; i < source.length; ++i)
{
if (this.indexOf(source[i]) !== -1)
{
foundChar = true;
break;
}
}
if (!foundChar)
return this;
var result = "";
for (i = 0; i < this.length; ++i)
{
var sourceIndex = source.indexOf(this.charAt(i));
if (sourceIndex !== -1)
result += dest[sourceIndex];
else
result += this.charAt(i);
}
return result;
}

Definition at line 428 of file CPComparisonPredicate.j.

var source = ['*','?','(',')','{','}','.','+','|','/','$','^']

Definition at line 425 of file CPComparisonPredicate.j.