Regex Test Letter uppercase | XM Community
Skip to main content
I am using Regex to validate a question that needs 2 uppercase letters. I have used [A-Z][A-Z] and [A-Z]{2}. I have also tried \\u. When testing the question it is still allowing lowercase. What am I doing wrong?

Thanks
Qualtrics validation regex is case insensitive and ignores shorthand character classes. As an alternative, you could use a JavaScript event handler to convert input to uppercase.
Thank you for the idea and sorry for my ignorance I'm on the newer side with my coding skills can you point me to an example of how this is done?

Thanks
Assuming you will still use regex validation and just need to convert to uppercase, add the following to the addOnload function. Change the [ to a { (changed to avoid Community 'Access Denied' error):

```

jQuery("#"+this.questionId+" .InputText").on('input', function () [this.value = this.value.toUpperCase();});

```
That worked like a charm thank you very much.

Leave a Reply