API  1.0.0
CPComparisonPredicate.j File Reference

Go to the source code of this file.

Variables

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

Variable Documentation

◆ dest

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

Definition at line 428 of file CPComparisonPredicate.j.

◆ escapeForRegExp

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;
}
var source

Definition at line 430 of file CPComparisonPredicate.j.

◆ source

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

Definition at line 427 of file CPComparisonPredicate.j.