• Blog
  • Changelog
  • Follow us on GitHubFollow us on XJoin our Discord server
  • Blog
  • GitHub
  • Releases
  • Getting started

    • Overview
  • Library

    • Getting started
    • Array
    • Result
    • Dependency injection
    • Resource management
    • Task
    • Type
    • Conventions
  • Local-first

    • Getting started
    • Playgrounds
    • Examples
    • Owners
    • Relay
    • Migrations
    • Time travel
    • Indexes
    • Protocol
    • Privacy
    • FAQ
  • Other

    • API reference
    • Comparison
    • Showcase
    • Changelog

API reference › @evolu/common › Type › regex

const regex: <Name>(
  name: Name,
  pattern: RegExp,
) => BrandFactory<Name, string, RegexError<Name>>;

Defined in: packages/common/src/Type.ts:1497

String matching a regular expression.

Example

const Alphanumeric = regex("Alphanumeric", /^[a-z0-9]+$/i)(String);
Markdown for LLMs

© 2026 Evolu

Follow us on GitHubFollow us on XJoin our Discord server