# What sanitizing is needed for writing from a text input field to a tag?

**URL:** <https://forum.inductiveautomation.com/t/what-sanitizing-is-needed-for-writing-from-a-text-input-field-to-a-tag/95540>\
**Category:** Ignition\
**Created:** [September 4, 2024, 5:17pm UTC](https://forum.inductiveautomation.com/t/what-sanitizing-is-needed-for-writing-from-a-text-input-field-to-a-tag/95540 "2024-09-04T17:17:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zach\_Larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zach_larson/32/54388_2.png) [@Zach\_Larson](https://forum.inductiveautomation.com/u/Zach_Larson)\
**Post date:** [September 4, 2024, 5:17pm UTC](https://forum.inductiveautomation.com/t/what-sanitizing-is-needed-for-writing-from-a-text-input-field-to-a-tag/95540/1 "2024-09-04T17:17:47Z")

</div>

I use runPrepUpdate to sanitize data going into my database.

What is necessary for sanitizing strings in input fields that I will write to tags?  
Should I implement a regex like Jordan's example here:

> [@Sanitizing user comment entries text field help](https://forum.inductiveautomation.com/t/sanitizing-user-comment-entries-text-field-help/57817/9):
>
> If you can standardize on a single replace character, the regex becomes simpler. import re Comments = self.parent.parent.getChild("topspacer flex\_5").getChild("TextField\_0").props.text pattern = re.compile('[^a-zA-Z0-9 -]') Comments = pattern.sub('', Comments)
