- Home /
TextMesh Pro Input Field Character Validation using Regex
Hello
How do I go about setting the Regex for the TextMesh Pro InputField?
I have set it to use Regex using
inputfield.characterValidation = TMPro.TMP_InputField.CharacterValidation.Regex;
But am unable to find out where to set said Regex string.
I am wanting to do this for a message input so it should only contain Alphanumeric and whitespace characters, if there is another or better way I'd like to know.
Thanks
PS: The add a line break isn't working using the method advised (two spaces then enter/return)?
Does anyone know?
Surely there is an answer for this and Im not the first person to try and use it?
Your answer
![](https://koobas.hobune.stream/wayback/20220612195300im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
"String too long for TextMeshGenerator. Cutting off characters." when doing Regex.Replace 3 Answers
default sprite missing after removing and reimporting tmp 0 Answers
Unity C#: removing special characters from a string 1 Answer
TextMesh update causing framerate drop 1 Answer
Is it possible to request a line break inside the Inspector? 6 Answers