Quartz Composer JavaScript Reference © Cybero Designs  

test

TypeProperty (R)
FormatRegularexpression object . Test (string contents) regexp.test([str])
Commentary
Tests for a match in its string parameter..Determines whether the string matches the pattern string check.If the string matches is true, if not it returns false.
Sample code - QC 2 JavaScript
str = "RegExp Sample Text. String Match Test.";
reObj = new RegExp ();
result = reObj.test ( "Te");
outputs [0] = "test result" + result + "";
Sample code - QC 3 JavaScript
var str = "ABCDEFGH";
var reObj = new RegExp();
var strOut = new Array();
var re = new RegExp();
function (__string strOut) main ()
{
var result = new Object();
if (re.test(str))
midstring = " contains ";
else
midstring = " does not contain ";
result.strOut =str + midstring + re.source;
return result;
}

Return to the Start Page