OK, so from the manual I can do this:item.setRegex(/^[1-9]$/); to define the validation regex in formapi.But what if I want to define a variable and use it as the regex (I am setting an array of choices and will choose the correct one)val="/^[1-9]$/";item.setRegex(val); does not workAny ideas ?