Skip to main content

Introduction to Regular Expression


What is a regular expression

Regular expressions provide a powerful, flexible and efficient way to work with text. It helps users to analyze the content of text fields to ensure that the content conforms to a predefined format ( such as email addresses, usernames, etc.).

Use Case

In the Customer Information worksheet, you need to record the customer's WeChat account, which is not allowed to have Chinese characters, only letters and numbers, in this case you can customize the rules to limit the input.

1. Expression Configuration

Regular expressions are only available in the text field, check [Limit input format] to start the configuration.

On the left side, there are commonly used expressions provided, you can click to select them or modify them to custom expressions. ( Custom expression can't be saved as common expression on the left side).

Depending on the Use Case, here select [letter and number] on the left.

After the configuration is complete, click [Confirm] and save the form.

2. Feature Description

  • Regular expression
    Edit the expression you need here, no spaces at the beginning, so pay attention to whether there are spaces when copying and pasting the expression.

  • Prompt for errors
    When the input content is not matched, it will prompt the user with the content here. For example, the prompt in the picture is "Please enter letter and number", you can modify it to "No Chinese characters allowed, only letters and numbers are supported".

  • Test
    Enter something to test if the expression and error message meet your needs.

3. Test

Submit a record for testing, as shown below.

Recommendation

Recommended site for learning regular expressions https://www.runoob.com/regexp/regexp-syntax


Have questions about this article? Send us feedback