TextDesk
English

Regex generator and tester

Try ready-made patterns for dates, emails and numbers, test them on your own text, or ask the AI for a new regex.

The AI helper is in a limited trial. If the usage limit is reached, only AI requests pause; examples and the tester keep working.

Start with an example

Each button loads a pre-checked regex and tests it on the sample text below. It does not call the AI.

Test a regex

A fixed, pre-checked example.

Matches

    Explanation

    Matches a 4-digit year, month 01–12 and day 01–31. It does not reject impossible dates such as 30 February.

    Examples

    Things to check

    Ask the AI for a regex

    Up to 1,500 characters. Use made-up examples rather than real personal data. The test text above is not sent to the AI.

    AI requests leave your device.

    The request or regex you type, the task type and the page language are sent through Cloudflare to the Anthropic Claude API. Cloudflare Turnstile is used for the security check. Your test text is not sent.

    Write your request, give consent, then press the button.

    Common regex syntax

    SyntaxMeaning
    .Any single character except a line break
    \dOne digit (0–9)
    \wOne letter, digit or underscore
    \sOne whitespace character (space, tab, line break)
    [abc]One of a, b or c
    [^abc]Any character except a, b or c
    ^ $Start and end of the line (or text)
    * + ?Repeat 0+ times · 1+ times · 0 or 1 time
    {2,4}Repeat 2 to 4 times
    ( )Group
    a|ba or b
    \bWord boundary

    What do the flags do?

    g finds every match instead of the first one, and i ignores case. m makes ^ and $ work on each line, s lets the dot match line breaks, and u treats Unicode characters such as emoji as single characters.

    Where can I use the pattern?

    Patterns here follow JavaScript. They usually behave the same in VS Code search and Google Sheets REGEXMATCH, but Python, Excel and databases each have small differences, so test again in the tool you will use.

    Watch out for slow patterns

    Nested repeats such as (a+)+ can become extremely slow on some inputs. This page runs each test in a separate worker and stops it after one second, so your browser never freezes.

    Excel and Google Sheets formula AI · Developer tools · Line tools · Privacy policy

    FAQ

    Do the examples and the tester cost anything?
    No. They run only in your browser and never call the AI.
    Is my test text sent to the AI?
    No. Only your request (or the regex to explain) is sent. The test text stays on your device.
    Will the regex work in Python or Excel?
    Often, but not always. This tool targets JavaScript, so check again in other environments.
    What if the AI regex is wrong?
    Do not use it blindly. Test it on text that should and should not match. For important validation, a regex alone may not be enough.