Skip to content

Regex Check Rule

Description

The Regex Check rule refers to the use of regular expressions (regex) to validate or enforce specific patterns in data. A Regex Check is essentially a data quality rule or process where regular expressions are used to ensure that data adheres to certain formats or standards.

Rule Configuration

A rule configuration is based on a pattern that occurs when the data being evaluated matches the defined sequence of characters in the pattern. In this context, the pattern is used to ensure that the data adheres to a specific structure or format, such as email addresses, phone numbers, or dates. When the data matches the pattern, it indicates that the rule configuration was successful, meaning the data conforms to the expected format.

  • Pattern A pattern refers to a sequence of characters that defines the structure or format you’re trying to match or validate in the data.

Success Criteria

The success criteria for a Regex Check focus on ensuring that data matches the exact structure, contains the appropriate characters, adheres to length constraints, and passes the specific validation rules defined in the regular expression pattern.

  • The success condition depends on how the Pattern is given.

  • The success condition is met if this count satisfies the given operator and value.

  • For Sample if RegexCheck pattern is set to validate only phone number and specific symbols then it wont validate data with alphabets.

    Configuration Fields

    • Operator Options

      • Greater than
      • Less than
      • Equal to
      • Between (requires specifying a start and end range)
    • Operator Defines the comparison operation (Greater Than, Less Than, Equal To, or Between).

    • Value The threshold value used for success criteria. Required for Greater than, Less than, and Equal to operators.

    • Value Range Required only when the Between operator is selected, specifying the start and end range.

    • Threshold Type Indicates whether the Value or Value Range to be considered as percentage or an absolute count.

    • Allow Null Values Determines if null values are permitted.

Sample Input

IDPhone NumberPasswords
1+8473865435Password#1
2+7835783578PASSWORD123
3a423895756512345678
4= 94857457644Abc123?!
5+8394757872abcd

Sample Rule Configuration

  • Pattern ^\+?[1-9]\d{1,14}$ (Phone Number) , ^(?=(.*\d))(?=(.*[a-z]))(?=(.*[A-Z]))(?=(.*[#?!])).{8,}$ (Password)

  • The Pattern ^\+?[1-9]\d{1,14}$ matches phone numbers that may optionally start with a + symbol for international formats. The number must begin with a non-zero digit and be followed by 1 to 14 additional digits, allowing a total length between 2 and 15 digits.

  • The Pattern ^(?=(.*\d))(?=(.*[a-z]))(?=(.*[A-Z]))(?=(.*[#?!])).{8,}$ used for secure passwords must contain at least eight characters, including at least one number, both lowercase and uppercase letters, and at least one special character such as #, ?, or !.

Sample Success Criteria Configuration

  • Operator Greater than
  • Value 2
  • Threshold Type Absolute Count
  • Allow Null Values True

alt text

Sample Output

Column NameRule NameSuccess CountFailure CountWithin Threshold
Phone NumberPhone Number Regex Check32Yes
PasswordsPasswords Regex Check23No