Custom Validation: Match Regex = using different language characters - URGENT HELP NEEDED | XM Community
Skip to main content

Hi all,
I have a single library reference block that has been translated into several languages. As such, the feedback and answers to a practice question change depending on the language that is selected.
For example, for English, participants would type in "PT" and they would be able to progress. For German, participants would type in "ÜZ". However, I am having an issue with participants using characters from other languages, such as "Ü" in this instance. I know that this is because of the match regex I have:
^>A-Z]{2}$
Two characters between A-Z only. I also know that "\\p{L}" exists to allow any language.
Could anyone please help me to put these two together so that the question will only accept two characters from any language, similar to the above regex?
Note - I have tried:
^>\\p{L}]}A-Z]{2}$
^\\p{L}LA-Z]{2}$
^{\\p{L}}}A-Z]{2}$
^\\p{L}{2}$

None of these seemed to work.
Any help would be greatly appreciated.
Thank you in advance.

Try:
^[\\p{L}]{2}$


Thank you, TomG ! One of the ones I did not think to add in.


Regex is tricky! Thank you TomG for a super fast response, we truly appreciate it! 🙂


Leave a Reply