Skip to main content

Open the editor with URL parameters

Use URL parameters to open an unsaved editor with a pattern and sample text. Opening the link does not save a workspace.

Free
Included
Pro
Included
Self-hosted
Included
Compare plans

For a saved, versioned link, use Save and share.

Supported parameters​

ParameterMeaning
regexPattern text without enclosing delimiters.
testStringOne test string, including encoded line breaks.
flavorEngine identifier, such as pcre2 or javascript.
flagsActive flags; use an empty string for no flags.
delimiterA delimiter supported by the selected flavor.
subst or substitutionSubstitution text.
extractionExtraction template.
langInterface language code, such as en, de, or pt-BR.

When both substitution aliases are present, subst wins.

Specify the flavor, flags, and delimiter when the example depends on them. Omitted values can use defaults or the reader's configuration.

If you supply a flavor without flags or delimiter, the editor uses that flavor's defaults. Unsupported configuration values are normalized by the editor.

See Engines for engine identifiers and differences.

Interface language​

Use lang to select the interface language when the page loads. For example, https://regex101.com/?lang=de opens the interface in German.

CodeLanguageCodeLanguage
enEnglishnlDutch
frFrenchdeGerman
zhChinesesvSwedish
esSpanishptBrazilian Portuguese
plPolishruRussian
roRomanianitItalian
idIndonesianjaJapanese
koKoreantrTurkish
viVietnamese

Codes are case-insensitive. A hyphenated locale uses its first part, so sv-SE selects Swedish and pt-BR selects Brazilian Portuguese.

Use hyphens for locale variants. An underscore form such as pt_BR is not recognized.

A supported lang value overrides the saved interface language for that page load. It does not change the saved setting.

An empty or unsupported value uses the saved language. Use lang=en to open English regardless of the saved language.

lang also works on saved workspace links. It changes interface text, not the regex flavor or the code generator's programming language.

Set flavor to choose the regex engine. In Code Generator, use Language to choose the programming language.

The code generator initially uses its configured default language. If no default is set, it selects a language from the regex flavor and editor mode.

Use URLSearchParams to encode the values. It preserves spaces, Unicode, ampersands, plus signs, hash signs, and line breaks through URL encoding.

The following example opens the substitution editor:

const url = new URL('https://regex101.com/substitution')
url.search = new URLSearchParams({
regex: '(?<key>[A-Z]+)=(?<value>.+)',
testString: 'NOTE=café & tea + cake #1\nORDER=ORD-2048',
flavor: 'pcre2',
flags: 'gm',
delimiter: '/',
subst: '$1: $2',
lang: 'en',
}).toString()

console.log(url.href)

Open the printed URL in your browser. The pattern matches each line and captures its key and value.

The substitution output is:

NOTE: café & tea + cake #1
ORDER: ORD-2048

A manually concatenated + can decode as a space. A raw # starts a fragment, and a raw & separates parameters.

Encode values before sharing the link. Do not encode the complete URL as one parameter.

Editor modes​

Choose the editor mode with its path:

PathMode
/Match
/substitutionSubstitution
/extractionExtraction
/unit-testsUnit tests
/substitution-pipelineSubstitution pipeline, subject to feature access

The mode path does not provide a schema for importing unit tests or pipeline stages through query parameters.

Parameters seed unsaved editor routes. A saved /r/{fragment}/{version} link loads its saved workspace; query parameters do not override its pattern or test strings.

URL content can appear in browser history, copied messages, and service logs. Use synthetic examples and omit credentials or private data.

For large samples or stable revisions, save a workspace and share its versioned link.