# Validate a CSV column with a regex

Validate one CSV column against a regex, with header or index selection, delimiter auto-detect, blank handling, inverted matching, and text or JSON reports.

## Run it

- **CLI:** `gizza tool regex-column-validate "name,zip
Ada,12345
Bo,1234
Cy,90210" 'column=zip' 'pattern=\d{5}'`
- **Web:** https://gizza.ai/tools/regex-column-validate/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/regex-column-validate/tool.json

## Inputs

- `data` — CSV data _(field)_
- `column` — Column name or 0-based index _(field)_
- `pattern` — Regex pattern _(field)_
- `full_match` — Require full-cell match _(field)_
- `ignore_case` — Ignore case _(field)_
- `report` — Flag which values _(field)_
- `has_header` — First row is a header _(field)_
- `allow_blank` — Allow blank cells _(field)_
- `delimiter` — CSV delimiter _(field)_
- `max_issues` — Max issues to list _(field)_
- `output` — Output format _(field)_

## Output

- Validation report (text)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `data` — CSV data
- `column` — Column name or 0-based index
- `pattern` — Regex pattern
- `full_match` — Require full-cell match
- `ignore_case` — Ignore case
- `report` — Flag which values
- `has_header` — First row is a header
- `allow_blank` — Allow blank cells
- `delimiter` — CSV delimiter
- `max_issues` — Max issues to list
- `output` — Output format

Example: `https://gizza.ai/tools/regex-column-validate/?data=name%2Czip%0AAda%2C12345%0ABo%2C1234%0ACy%2C90210&column=zip&pattern=%5Cd%7B5%7D&full_match=true&ignore_case=true&report=non-matching&has_header=true&allow_blank=true&delimiter=auto&max_issues=50&output=text`

---

## About this tool

Regex Column Validate checks one CSV column against a regular expression and lists
which rows fail the rule. Use it for format checks such as ZIP/postal codes,
phone-like IDs, invoice numbers, SKU shapes, or any one-column data-quality rule
that is easier to express as a regex.

By default the regex must match the whole cell. Turn off full-cell matching when
you only need the pattern to appear somewhere inside each value. You can also
invert the report to flag values that **do** match a forbidden pattern.

### Worked example

CSV:

```csv
name,zip
Ada,12345
Bo,1234
Cy,90210
```

With column `zip`, pattern `\d{5}`, and full-cell matching on, the text report
flags Bo's row because `1234` has only four digits:

```text
Rows checked: 3
Valid: 2
Invalid: 1
row 2 (line 3): "1234" — does not match the pattern
```

## Limits & edge cases

- Regex syntax is Rust `regex` syntax. Backreferences and look-around are not
  supported by that engine.
- Use inline flags such as `(?i)`, `(?m)`, or `(?s)` for advanced regex modes.
- Numeric column selections are 0-based indexes. Header names work when the
  header checkbox is on.
- `max_issues` only caps the listed rows. The total invalid count is still
  reported.
- Blank cells can be allowed or treated as invalid before regex matching.

## FAQ

<details>
<summary>Does the pattern have to match the whole cell?</summary>

By default, yes. The tool anchors the pattern to the full cell so `\d{5}` means
exactly five digits. Turn off "Require full-cell match" to accept any substring
match inside the cell.

</details>

<details>
<summary>Can I find values that match a forbidden pattern?</summary>

Yes. Change "Flag which values" to "Values that match". That inverts the report
and is useful for finding all-caps placeholders, test IDs, or other disallowed
formats.

</details>

<details>
<summary>How do I use case-insensitive or multiline regex flags?</summary>

Use the checkbox for case-insensitive matching, or embed Rust regex inline flags
in the pattern, such as `(?i)hello` or `(?m)^ID-\d+$`.

</details>

<details>
<summary>Can it validate multiple columns at once?</summary>

No. This focused tool validates one column and one regex rule per run. For a
larger schema with multiple rules, use a dedicated data validator or run this
tool once per column.

</details>

## Related tools

- [CSV Column Type Validator](https://gizza.ai/tools/csv-column-type-validator/): Validate CSV columns against declared types like int, float, bool, date, and enum, with row/line reports for every offending cell.
- [Validate CSV structure](https://gizza.ai/tools/csv-structure-validator/): Validate CSV structure online: find ragged rows, inconsistent column counts, unclosed quotes, and stray delimiters with line numbers. Free, private, in-browser.
- [Date Column Validator](https://gizza.ai/tools/date-column-validate/): Check every value in one CSV date column against a chosen format — ISO, US, EU, RFC 3339, or a custom pattern — with a per-row report of invalid dates.
- [Check a CSV column against an allowed set of values](https://gizza.ai/tools/enum-domain-check/): Check one CSV column against allowed categories and flag out-of-set values with counts, row locations, blank handling, and text or JSON reports.
- [Amazon Order Analyzer](https://gizza.ai/tools/amazon-order-analyzer/): Paste an Amazon order-history CSV export to summarize total spend by month, top items, and category breakdowns. Browser-only, private, with Markdown or JSON output.
