Launching a SaaS?·Collect waitlist signups before you build — before.run
SandboxPatternsDetectDocsChangelog
Dev
#git
#sha
#commit
#version-control

Git Commit SHA

Matches a Git commit SHA — either short form (7+ chars) or full 40-character SHA-1 hash.

CI/CD pipelinesDeployment trackingCode review tools
/
/
Safe
Test String
2 matches
[…]{7,40}Character class […]Matches any single character listed in this set — repeated between 7 and 40 times · {7,40} — between 7 and 40 times
0-90-90-9 — range from '0' to '9'
a-fa-fa-f — range from 'a' to 'f'
Pattern: 14 charsInput: 48 chars
100% client-side · private

Valid Examples

  • a1b2c3d
  • a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2

Invalid Examples

  • xyz
  • ZZZZZZ
  • 123456

Usage & Integration

Validate Git Commit SHA natively in your backend or frontend without copying regex strings.

Node / Edge

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

validate('git-sha', '...');

Python

from regexto_validators import validate

validate("git-sha", "...")

Go

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

valid, err := validators.Validate("git-sha", "...")

PHP

use RegexTo\Validators\Validator;

Validator::validate('git-sha', '...');

Rust

use regexto_validators::validate;

let is_valid = validate("git-sha", "...").unwrap();