Launching a SaaS?·Collect waitlist signups before you build — before.run
SandboxPatternsDetectDocsChangelog
Security
#base64
#encoding
#data

Base64 Encoded String

Matches a valid Base64-encoded string with proper padding using = characters.

File upload validationAPI token parsingImage data URIs
/
/
Risk
Test String
No matches
^^^ — start of string (or line in multiline mode)
(?:…)*Non-capturing groupNon-capturing group — groups without capturing (no index assigned) — repeated zero or more times (greedy) · * — zero or more times (greedy)
[…]{4}Character class […]Matches any single character listed in this set — repeated exactly 4 times · {4} — exactly 4 times
(?:…)?Non-capturing groupNon-capturing group — groups without capturing (no index assigned) — repeated zero or one time (optional) · ? — zero or one time (optional)
[…]{2}Character class […]Matches any single character listed in this set — repeated exactly 2 times · {2} — exactly 2 times
=='=' — literal character
=='=' — literal character
||| — alternation: matches expression on left OR right
[…]{3}Character class […]Matches any single character listed in this set — repeated exactly 3 times · {3} — exactly 3 times
=='=' — literal character
$$$ — end of string (or line in multiline mode)
Pattern: 67 charsInput: 38 chars
100% client-side · private

Valid Examples

  • SGVsbG8gV29ybGQ=
  • dGVzdA==
  • YWJjZGVmZ2g=

Invalid Examples

  • SGVsbG8gV29ybGQ
  • not!base64@string
  • YWJjZGVmZ2g===

Usage & Integration

Validate Base64 Encoded String natively in your backend or frontend without copying regex strings.

Node / Edge

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

validate('base64', '...');

Python

from regexto_validators import validate

validate("base64", "...")

Go

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

valid, err := validators.Validate("base64", "...")

PHP

use RegexTo\Validators\Validator;

Validator::validate('base64', '...');

Rust

use regexto_validators::validate;

let is_valid = validate("base64", "...").unwrap();