Limit the number , alphanumeric entry

Hello ,

Good Morning all!
I would like to limit the number of characters in a field with Commcare and also text mix in Text question. I use string-length(.)=9 but it's was limit number only.

Commcare explain the function as * regex(. , '^[0-9A-Za-z]+$') but it's was not.

How can I do this.

Best regards,

Hell , I got it. This is only limit text length. can type number only or text and number 9 digit.

string-length(.) = 9