Criteria for testing numbers and spaces while using indexOf
// var name = layer.name;
// gets changed over to null given certain criteria
// var name = '';
// criteria depends on layer name starting with “XX T”
// and have numbers 1 thru 99 following ... as in “XX T##”
// and after the numbers also test that if there are more characters in the layer name that a space follows ... as in “XX T1 “ or “XX T99 “ so that "XX T1 Teststing 123" can be true
// results are that layer names that do not match the criterial have var name = ‘’;
// and layers that do start with "XX T##" or “XX T## ” have the “var name = “ left unchanged
// examples of layers with (var name = layer.name;) where the variable is left unchanged:
// “XX T1” or “XX T75” or “XX T1 “ or “XX T99 “ or “XX T1 testing 123”
// for the example "XX T1" to be true there would be no reason to test that a space follows the last number but the layer name must not cotain anything else and be the exact name match "XX T1"
// if there is text following the last number a blank space must be included in criteria as in “XX T1 testing 123”
// examples of layers that have the variable name (var name = layer.name;) changed to (var name = ‘’;)
// layer names that do not start with "XX T"
// “XX T” with no two possible numbers following the “T”
// “XX T 75” with a blank space after the “T”
// “XXT1” with no blank space between “X T”
// “123XX T1” that don’t start with “XX T”
// “XX T1Testing 123” that don’t have a space following the last number
if (isPossible) {
var name = layer.name;
if (name.indexOf(‘XX T') === -1) name = ''; // need help expanding this criteria
}
// based on criteria I push the contents of the variable “name” to an array
// then in array
if (layer.name === ""){
var name = "";
}
// array condition if layer name starts with “XX T##“ or “XX T## “
if (layer.name !== ""){
var name = layer.name
}
// actions that follow but the way I have it set up only works for exact name match only
// I need help including instances where charaters follow as in “XX T1 testing 123”
// also not sure if (!!name) is required
if (name === “XX T1" && (!!name)) {.
var t1 = “Cool Beans”;
}
if (name === “XX T69” && (!!name)) {
var t69 = “Yeah Buddy”;
}
