ToolRecipe

What do you need to get done?

Drop a file here

or .

Open an app

Follow a recipe

All recipes

Use one tool

All tools

Regex escape encode

Escape text for use in a regular expression. Every character that has a special meaning, such as . * + ? ( ) [ ] { } | ^ $ and the backslash, gets a backslash in front, so a regex matches your text literally. Runs in your browser, nothing is uploaded.

How to escape text for a regex

  1. 1Paste or type the text you want to match literally
  2. 2Read the escaped pattern in the result box
  3. 3Copy it into your regex, code or search field
  4. A pattern that matches your text exactly as typed.

What you get

  • Literal match.The escaped text matches only itself, not a pattern.
  • Nothing is uploaded.The text is escaped by your browser, on your own device.
  • Updates as you type.Edit the input and the pattern follows.

What you can do

  • Escape the 14 characters . * + ? ^ $ { } ( ) | [ ] and \ so a regex treats them as plain text.
  • Look up a URL, a price, a file path or a sentence with punctuation in a pattern without surprises.
  • Build a pattern from user input safely in code, by checking what the escaped form looks like.
  • Copy the result with one click.

Good to know

  • The hyphen and the forward slash are not escaped. Inside a character class a hyphen can still act as a range, and in a regex literal you need to escape / yourself.
  • Letters and digits stay as they are, and so do spaces and line breaks.
  • The escaping follows the JavaScript style. Other regex engines may treat a few characters differently.
  • Test the result with the Regex tester before you rely on it.

Questions

How do I escape a string for a regex?

Paste the text into the input box. The result box shows it with a backslash in front of every special character.

Which characters are escaped?

The dot, asterisk, plus, question mark, caret, dollar sign, braces, parentheses, pipe, square brackets and the backslash.

Why escape at all?

Without it, a dot matches any character and a ( can break the pattern. Escaping makes the regex match your text exactly.

Is my text uploaded?

No. The conversion runs in your browser and nothing is sent.

How it works

Small tools that run in your browser.

Four steps

  1. Start with a file or a task

    Drop a file, search, or pick a task.

  2. The tool opens in a window

    Open as many as you like, side by side as tabs.

  3. Results collect on the right

    Drag a result into the next tool.

  4. Save when you're done

    Saved files go to your downloads.

Who uses what

Tool sets for common jobs.

Put a tool on your home screen

The icon opens that tool, like an app.

iPhone and iPad

  1. Open the tool in Safari.
  2. Tap Share (the square with the arrow).
  3. Choose “Add to Home Screen”, then Add.

Android

  1. Open the tool in Chrome.
  2. Tap the menu (⋮) at the top right.
  3. Choose “Add to Home screen” or “Install app”.

Computer

  1. Open the tool in Chrome or Edge.
  2. Click the install icon in the address bar.
  3. Choose Install.

Skills

Claude skills we use ourselves, one job each.