Customize

Check Values Using Regular Expressions

Summary

Use a pattern matching method known as “regular expression” to verify whether the field adheres to a specific format.

How to use

Verify if the field value matches the given regular expression pattern; if it doesn’t, show an error message in that field.

Understanding regular expressions is essential.

If any errors are found, a list of corresponding field codes will be provided. If all fields are correct, the result will be an empty list. If a field is specified in the table, the action’s result will only apply to the last row of the table. The results of other rows are not reflected, so caution is necessary.

Parameters

Set Field, Regular Expression, and Error Message.

Field

Select which field to check.

This parameter accepts the following field types:

  • Text
  • Text area
  • Rich text
  • Link

When selecting multiple fields, each of those fields will be checked individually.

If you select a field inside a table, all rows of that table will be processed. For exceptions: See (*1)

*1: If you set a Condition that only applies to some table rows (such as the Condition “When Fields Value Changed”), the value will be set only for those affected by that Condition.

Regular Expression

Enter the regular expression to check. An error is identified when the content does not conform to this regular expression.

Error Message

Enter an error message to display if the content does not match the specified regular expression.

Compatibility with krewSheet

The action is supported only under the following conditions:

You cannot set multiple errors at the same time. The error set last will be displayed in the krewSheet.

Differences in operation compared to the old version:

There are changes in operation in Customine version 1.161 (released on February 10, 2022). To maintain compatibility, versions prior to 1.160 (released on January 27, 2022) can continue to be used under the name “Check Values Using Regular Expressions (old).” The differences in operation between the old and new versions are as follows:

  • The regular expression metacharacters ‘^’ and ‘$’ handling differs between versions.
    • In versions before 1.160: ‘^’ matches only at the very beginning of a sentence, while ‘$’ matches only at the very end, meaning they do not match at the start or end of the line.
    • Starting from version 1.161: ‘^’ matches the beginning of a line and the start of the string, and ‘$’ matches the end of a line and the end of the sentence, allowing for multiline mode.