Launching a SaaS?·Collect waitlist signups before you build — before.run
SandboxPatternsDetectDocsChangelog
Crypto
#ipfs
#cid
#content-address
#decentralized

IPFS CID

Matches an IPFS Content Identifier (CIDv0 starting with Qm, or CIDv1 starting with bafy/bafk).

IPFS gateway linksNFT metadata validationDecentralized storage
/
/
Safe
Test String
2 matches
(…)Group #1Capturing group — captures matched text for reuse or extraction
QQ'Q' — literal character
mm'm' — literal character
[…]{44}Character class […]Matches any single character listed in this set — repeated exactly 44 times · {44} — exactly 44 times
||| — alternation: matches expression on left OR right
bb'b' — literal character
[…]{58,}Character class […]Matches any single character listed in this set — repeated at least 58 times · {58,} — at least 58 times
Pattern: 43 charsInput: 106 chars
100% client-side · private

Valid Examples

  • QmZ4tDuvesekSs4qM5ZBKpXiZGun7S2CYtEZRB3DYXkjGx
  • bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi

Invalid Examples

  • not-a-cid
  • Qm1234
  • 0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe

Usage & Integration

Validate IPFS CID natively in your backend or frontend without copying regex strings.

Node / Edge

import { validate } from '@regexto/validators';

validate('ipfs-cid', '...');

Python

from regexto_validators import validate

validate("ipfs-cid", "...")

Go

import "github.com/regex-to/validators-go"

valid, err := validators.Validate("ipfs-cid", "...")

PHP

use RegexTo\Validators\Validator;

Validator::validate('ipfs-cid', '...');

Rust

use regexto_validators::validate;

let is_valid = validate("ipfs-cid", "...").unwrap();