var atLeastOne:RegExp = /[0-4]+/g; var zeroOrOne:RegExp = /[0-4]*/g; var atLeastOne2:RegExp = /[0-4]+?/g; var zeroOrOne2:RegExp = /[0-4]*?/g; var firstString:String = "12430"; var secondString:String = "663323"; firstString.match(atLeastOne));//returns "1243" secondString.match(atLeastOne));//returns "3323" because we want as many characters as will match firstString.match(zeroOrOne));//returns "1243" the first few characters match secondString.match(zeroOrOne));//returns "" because the first few characters don't mat ch, we stop looking firstString.match(atLeastOne2));//returns "1,2,4,3" because all we need is one match secondString.match(atLeastOne2));//returns "3,3,2,3" firstString.match(zeroOrOne2));//returns "" secondString.match(zeroOrOne2));//returns "" zeroOrOne2.test(firstString));//returns true zeroOrOne2.test(secondString));//returns false