--- title: "Require Alphanumeric Characters in Form Response" slug: "require-alphanumeric-characters-in-form-response" status: "new" updated: 2026-07-21T20:17:12Z published: 2026-07-21T20:17:12Z canonical: "knowledge.technolutions.net/require-alphanumeric-characters-in-form-response" stale: true --- > ## Documentation Index > Fetch the complete documentation index at: https://knowledge.technolutions.net/llms.txt > Use this file to discover all available pages before exploring further. # Require Alphanumeric Characters in Form Response If you want to require alphanumeric characters in a [form](/v1/docs/forms-overview) response, you can use a format mask and a simple regular expression (regex) string to match your required pattern. > [!TIP] > ⭐ Get Inspired > > This article was adapted from [a post by Technolutions staff](https://community.technolutions.net/get-inspired/post/using-regex-to-ensure-alphanumeric-characters-are-used-in-a-text-box-2Ozrya6p5DaihlG) in the Slate Community Forums' Get Inspired space. Have a great idea for a Get Inspired post? [Let us know](https://community.technolutions.net/get-inspired/new?post_type=gnHx7As1gZ8r6Ld)! ## Before you begin - This article assumes basic familiarity with regex syntax. - To add a format mask to a form field, select **Edit Field** on the field and enter the value in **Format Mask**. - If you need a broader introduction to format masks, start with [Format Mask in Forms](https://knowledge.technolutions.net/docs/format-mask-in-forms). - Test every regex pattern thoroughly before using it in production. ## Example: match the word `Slate` The examples below show progressively stricter ways to match the word `Slate` in a text field. ### Match `Slate` anywhere in the value Use this format mask: ```plaintext /Slate/ ``` This pattern matches any value that contains the exact text `Slate`. Examples that match: - `Slate` - `My Slate account` Examples that do not match: - `slate` - `SLATE` Use this when capitalization must remain exact and the value can contain other text before or after the word. ### Match `Slate` or `slate` Use this format mask: ```plaintext /[Ss]late/ ``` `[Ss]` tells the regex engine to match either uppercase `S` or lowercase `s`. Examples that match: - `Slate` - `slate` - `using slate today` Examples that do not match: - `SLATE` - `sLATE` Use this when the value may contain other text, but you want to allow only these two common capitalizations of the word. ### Match `Slate` or `slate` as a standalone word Use this format mask: ```plaintext /\\b[Ss]late\\b/ ``` `\\b` marks a word boundary. This prevents the pattern from matching `Slate` as part of a longer word. Examples that match: - `Slate` - `slate` - `Slate!` - `Welcome to Slate today` Examples that do not match: - `slates` - `slatework` Use this when the word must appear on its own, even if other text is also present in the field. ### Match only `Slate` or `slate` Use this format mask: ```plaintext /^[Ss]late$/ ``` `^` anchors the pattern to the beginning of the value, and `$` anchors it to the end. Together, they require the full value to match the pattern. Examples that match: - `Slate` - `slate` Examples that do not match: - `Slate!` - `My Slate account` - `slates` Use this when the field should accept only the single word `Slate` or `slate`, with no additional characters. ### Match only `Slate`, `slate`, `Slate!`, or `slate!` Use this format mask: ```plaintext /^[Ss]late(?:[!]|$)$/ ``` This pattern still requires the full value to match from beginning to end, but it also allows an exclamation point at the end. Examples that match: - `Slate` - `slate` - `Slate!` - `slate!` Examples that do not match: - `Slate?` - `My Slate!` - `slates` Use this when you want to allow a very specific punctuation variation without accepting other trailing characters. ## Choose the right boundary Use `\\b` when the word can appear inside a longer sentence but still needs to stand on its own. Use `^` and `$` when the entire field value must match the pattern. ## Validate the result After adding a regex format mask: - Test values that should pass. - Test values that should fail. - Check variations in capitalization, punctuation, and spacing. - Remember that changing a format mask does not automatically reformat existing saved values. Existing data updates when the tab is edited and resaved. ## When regex may not be the best tool Regex works well for text-pattern validation, but it is not always the simplest solution. If the requirement depends on other fields, multiple conditions, or business logic, consider using [calculation formulas](https://knowledge.technolutions.net/docs/using-formulas-in-queries) or [submission conditions](https://knowledge.technolutions.net/docs/access-and-submission-conditions) instead.