# Identify Special Characters in Text Feild

**URL:** <https://forum.inductiveautomation.com/t/identify-special-characters-in-text-feild/30932>\
**Category:** Ignition\
**Created:** [December 26, 2019, 10:03am UTC](https://forum.inductiveautomation.com/t/identify-special-characters-in-text-feild/30932 "2019-12-26T10:03:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunil.sitro](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@sunil.sitro](https://forum.inductiveautomation.com/u/sunil.sitro)\
**Post date:** [December 26, 2019, 10:03am UTC](https://forum.inductiveautomation.com/t/identify-special-characters-in-text-feild/30932/1 "2019-12-26T10:03:41Z")

</div>

Hello,

Is there any way to identify Special characters entered in the text field, and same thing i need to display the message saying “Special Characters are not Allowed”.

Thanks,  
Sunil

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 26, 2019, 1:27pm UTC](https://forum.inductiveautomation.com/t/identify-special-characters-in-text-feild/30932/2 "2019-12-26T13:27:32Z")

</div>

Since “special characters” means different things to different people and in different contexts, there’s no one answer. The simplest solution is to use a validation expression to identify acceptable characters. A regexp like this:

```auto
[a-zA-Z][a-zA-Z0-9 _]*

```

will allow only spaces and alphanumerics and underscores, but starting with a letter.

Edit: this is part of the FormattedTextField:  
[https://docs.inductiveautomation.com/display/DOC79/Formatted+Text+Field](https://docs.inductiveautomation.com/display/DOC79/Formatted+Text+Field)

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [December 26, 2019, 1:29pm UTC](https://forum.inductiveautomation.com/t/identify-special-characters-in-text-feild/30932/3 "2019-12-26T13:29:28Z")

</div>

Welcome to the community!!

Here's an example that may help you.

> [@Restrict text input](http://forum.inductiveautomation.com/t/restrict-text-input/27582):
>
> Curious the best way to go about this. I want to restrict a text input to a specific length, must be 6 characters (no more, no less), and each position is restricted to certain characters. For example, the first position can only have C,E,F,G,V. The 2nd-6th will have similar restrictions. I’m assuming I will use the key press event? Anyone have any additional tips or help? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![sunil.sitro](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@sunil.sitro](https://forum.inductiveautomation.com/u/sunil.sitro)\
**Post date:** [January 8, 2020, 9:48am UTC](https://forum.inductiveautomation.com/t/identify-special-characters-in-text-feild/30932/4 "2020-01-08T09:48:36Z")

</div>

Thanks pturmel!

---

<div class="post-metadata">

**Author:** ![sunil.sitro](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@sunil.sitro](https://forum.inductiveautomation.com/u/sunil.sitro)\
**Post date:** [January 8, 2020, 9:53am UTC](https://forum.inductiveautomation.com/t/identify-special-characters-in-text-feild/30932/5 "2020-01-08T09:53:39Z")

</div>

Thanks jlandwerlen!
