DocsValidators

bic validator

SWIFT/BIC code shape check — 8 or 11 chars, no checksum.

Format

Matches `/^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$/` after uppercasing. 6-letter institution + 2-char location, optionally followed by a 3-char branch.

Examples

  • UBSWCHZH80A (UBS Zurich, full BIC11)
  • DEUTDEFF (Deutsche Bank Frankfurt, BIC8)
  • CHASUS33

Implementation

Faithful summary of lib/validators.ts. Validators are pure functions and run identically in the worker, the Workbench, and the MCP server.

function validBic(value) {
  return /^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$/.test(value.toUpperCase())
    ? OK
    : fail('bic_invalid', 'not a BIC')
}

Use in a template

Validators attach to a field on a custom template. The cascade runs them after mapping but before commit; failures surface in the per-row validation report.

fields:
  - column: bic
    type: string
    validators:
      - type: bic

Common gotchas

  • Shape only — no SWIFT directory lookup, no test BIC carve-out. Length 9 and 10 are rejected (the standard skips them).
  • Input is uppercased before matching, so mixed-case input passes if otherwise valid.
  • No template in the default catalogue uses `bic` yet — wire it explicitly on custom templates.

Related templates

No template in the default catalogue ships with bic preconfigured. Use it on a custom template via the YAML snippet above, or via the template editor.

Pricing

Validators run on every committed row

Schema-only mode (headers + ≤3 sample rows) is free and unlimited; full-data commits are metered. See plans →