DDSL

A Domain-Specific Language for Domain Names

A declarative language for describing finite sets of domain names using structural patterns. Write an expression, and DDSL expands it into all matching domain names.

Enter an expression to expand

Syntax Reference

Literals

Plain text: letters, digits, and hyphens

example my-site

Alternations

Choose between two or more options

{app,api,www} {com,net,org}

Character Classes

Ranges with optional repetition

[a-z] [a-z]{3} [a-z]{2,4}

Negated Classes

Exclude characters with ^

[^aeiou]{3} [^0-9]{2}

Named Classes

[:v:] vowels, [:c:] consonants

[[:v:]] [[:c:]]{3} [[:c:]0-9]{2}

Grouping

Group elements, with optional repetition

(abc) (ab){2,3}

Optional

Make a group or element optional with ?

car(s)? (-v[0-9])?

Nesting

Combine patterns in alternations

{smart{car,bike},fast} {[a-z]{3},foo}

Variables

Define and reuse patterns

@tlds = {com,net} example.@tlds

Comments

Add notes with #

# API domains api.com # main

Examples

Multi-line Examples

#set prefixes & suffixes
@prefix = {ab,rs,ev,pb}
@suffix = {ai,si}

#set keywords
@keywords = {agent,assistant,studio,lab,stack}

#alternate tlds
@tlds = {com,ai}

#generate
@prefix@keywords.@tlds
@keywords@suffix.@tlds

results →
abagent.com
abagent.ai
abassistant.com
..
agentai.com
agentai.ai
agentsi.com
@tlds = {com,net,org}
@env = {dev,prod}

# API endpoints
api.@env.example.@tlds

results →
api.dev.example.com
api.dev.example.net
api.dev.example.org
api.prod.example.com
api.prod.example.net
api.prod.example.org

Links