0

var pattern =/a{3,6}/g
var newValue="aa1a"
if(!pattern.test(newValue)){
gs.print("Only consecutive `a` characters between 3 and 6 (inclusive) allowed");
}

var pattern =/a{3,6}/g
var newValue="aaa"
if(!pattern.test(newValue)){
gs.print("Only consecutive `a` characters between 3 and 6 (inclusive) allowed");
}
else
{
gs.print("Only consecutive aaa aaaa aaaaaaaaaa allowed. Nice Job");
}

Matches between 3 and 6 (inclusive) consecutive `a` characters. (Regex)
admin Changed status to publish December 26, 2023