---
title: String Value Matching
description: Validates string values based on exact, partial, or pattern-based matching criteria.
group: Validity
---

# String Value Matching

The **String Value Matching** rule validates that string values in a column meet specific matching patterns like exact match, partial match (starts/ends with), or contain a substring.  
This rule is commonly used to:

- Detect inconsistencies in names, codes, or descriptions
- Enforce formatting standards in text fields  

**Example Usage**:  
Ensure customer names either start with 'Dr.' or 'Mr.' and contain the word 'Smith', or validate product codes follow a pattern like 'PC-###'.

---

## Configuration Fields  

### Rule-Specific Configuration  

| Field Name        | Description                                                              | Required | Data Type / Options                      |
|:-----------------|:-------------------------------------------------------------------------|:-----------|:------------------------------------------|
| **Match Type**     | Type of string comparison to apply                                        | Yes       | `Exact Match`, `Starts and Ends with`, `Contains` |
| **Start String**   | Text that the value should start with (applicable if Match Type allows)   | No        | String                                   |
| **End String**     | Text that the value should end with (applicable if Match Type allows)     | No        | String                                   |
| **Pattern String** | Text pattern the value should contain (applicable if Match Type allows)  | No        | String                                   |
| **Case Sensitive** | Whether string comparisons should be case-sensitive                      | Yes       | `true` / `false`                         |

---

### Success Criteria Configuration  

This section defines how the rule’s outcome is measured against expected thresholds.

| Field Name        | Description                                                 | Required | Options / Format                                                             |
|:------------------|:------------------------------------------------------------|:-----------|:-----------------------------------------------------------------------------|
| **Operator**        | Comparison operation for the result count                   | Yes       | `GreaterThan`, `LessThan`, `EqualTo`, `Between`                             |
| **Threshold Value** | Value for comparison (single value for most operators)      | Conditional| Number                                                                      |
| **Threshold Min**   | Minimum value (for `Between` operator)                      | Conditional| Number                                                                      |
| **Threshold Max**   | Maximum value (for `Between` operator)                      | Conditional| Number                                                                      |
| **Is Percentage**   | Whether the threshold represents a percentage or count      | No        | `true` / `false` (default: `false`)                                         |
| **Allow Nulls**     | Should null values be treated as valid                      | No        | `true` / `false` (default: `false`)                                         |
| **Check For Match** | When `false`, validates for negation of the condition       | No        | `true` / `false` (default: `true`)                                          |

---

## Sample Input Data  

| ID | Customer        | Country         |
|:----|:----------------|:----------------|
| 1  | Fallon          | Great Britain    |
| 2  | Franklyn Fryer  | France           |
| 3  | Kathleen        | United States    |
| 4  | Judie Green     | France           |
| 5  | John Doe        | null         |

---

## Sample Configurations  

### Example 1: Starts and Ends With Check  



| Configuration Field | Value               |
|:---------------------|:---------------------|
| Column                | Customer             |
| Match Type            | `Starts and Ends with`|
| Start String          | `John`               |
| End String            | `Doe`                |
| Case Sensitive        | `true`               |
| Operator              | `GreaterThan`        |
| Threshold Value       | 1                    |
| Is Percentage         | `false`              |
| Allow Nulls           | `false`              |
| Check For Match       | `true`               |

**Explanation**:  
Validates that more than one customer name starts with `John` and ends with `Doe`, case-sensitive.

---

### Example 2: Contains Pattern Check  


| Configuration Field | Value             |
|:---------------------|:-------------------|
| Column                | Country             |
| Match Type            | `Contains`          |
| Pattern String        | `France`            |
| Case Sensitive        | `false`             |
| Operator              | `EqualTo`           |
| Threshold Value       | 2                   |
| Is Percentage         | `false`             |
| Allow Nulls           | `true`              |
| Check For Match       | `true`              |

**Explanation**:  
Validates that exactly two Country values contain the word `France`, case-insensitive.

---

## Sample Output  

| Column Name | Rule Name             | Success Count | Failure Count | Null Count | Within Threshold |
|:------------|:----------------------|:---------------|:---------------|:------------|:------------------|
| Customer     | String Value Matching | 1             | 4             | 0          | No               |
| Country      | String Value Matching | 3             | 2             | -          | Yes              |

---
