Back to Utils

Notepad++ plugin

Regex Viewer

Paste a regex the way you got it — bare, in a piece of code, or in a whole answer from ChatGPT or Claude — and see right away what it does in the document you have open.

Goal

Hardly anyone writes regular expressions by hand anymore. You ask an AI assistant or look it up, and get something like re.compile(r"^(?P<date>\d{4}-\d{2}-\d{2})\s+(?P<level>ERROR|WARN)\b"). Then the questions start: does this really match my lines? What does each part do? And how do I use it in Notepad++'s Find/Replace?

Regex Viewer takes the regex out of whatever you paste — Python, JavaScript, C#, Java, PHP, Go, PowerShell, sed or grep, or a markdown code block — including its flags and replacement. Every match lights up in your document, each group in its own colour, and next to it each part of the pattern is explained.

By default the plugin matches exactly the way Notepad++'s Find would, with the same regex engine (Boost.Regex). Want to see what Python or JavaScript does with it? Pick that language. Written in C++, no internet connection needed, source open (MIT license) on GitHub.

What to expect

Paste what you got

A bare regex, a line of code or a whole AI answer with code blocks: the regex, its flags (re.MULTILINE, /gi, RegexOptions …) and the replacement are taken out. Several regexes in one paste? Pick one.

Groups in colour

Every match highlighted in your document, each group in its own colour — the same colours as in the pattern. The list next to it shows every match with its groups; double-click to jump to it.

Plain-language explanation

Part by part: \d{4} is 'exactly 4 digits', (?=\.) is 'followed by a "."'. The highlights come from the engine itself and are exact; the explanation is a reading aid.

Notepad++ or the source language

By default like Notepad++'s Find, with a warning when the source language would behave differently. Or pick Python, JavaScript, .NET, Java, PCRE, POSIX (grep/sed) or RE2 (Go, Google Sheets).

Replace and Replace all

The replacement (\g<1>, $1, ${name} …) is converted to Notepad++ syntax. Replace all is a single undo step.

Safe on large files

Matching runs in the background; on large files you see the visible part first. A regex that would run forever is stopped after 2 seconds, with the line where it happened.

See it in action

One line of Python pasted, and the explanation Regex Viewer gives with it. In the document, the date and the level are highlighted in their own colours.

Pasted

pattern = re.compile(
    r"^(?P<date>\d{4}-\d{2}-\d{2})\s+(?P<level>ERROR|WARN)\b"
)

Explanation

^             start of a line
(?<date>      group 1 "date":
  \d{4}       exactly 4 digits
  -           a "-"
  \d{2}       exactly 2 digits
  -           a "-"
  \d{2}       exactly 2 digits
\s+           one or more whitespace characters
(?<level>     group 2 "level":
  ERROR|WARN  one of these alternatives:
    ERROR     the text "ERROR"
    WARN      the text "WARN"
\b            a word boundary

Why 'like Notepad++' makes the difference

The same regex doesn't behave the same everywhere. In Python without re.MULTILINE, ^ matches only at the start of the whole text; in Notepad++ at the start of every line. On a log file that is easily 1 match against hundreds. Regex Viewer shows what Notepad++ does by default, and reports the difference: "In Python … 1 match instead of 37".

Usage

1. Installation

Not yet in Notepad++'s Plugins Admin (submitted) — manual install:

Download RegexViewer.zip from the latest release and unzip it into the Notepad++ plugin folder (64-bit Notepad++ required):

C:\Program Files\Notepad++\plugins\
  RegexViewer\
    RegexViewer.dll
    help.txt
Download the latest release

2. Activate plugin

Restart Notepad++. The plugin appears under Plugins → Datamodder Regex Viewer.

3. Get started

Click the magnifier in the toolbar, paste your regex into the panel at the bottom, or select a regex in a file and choose:

Plugins → Datamodder Regex Viewer → Explain selection as regex
Plugins → Datamodder Regex Viewer → Paste regex from clipboard

Frequently asked questions

Is this plugin really free?

Yes, completely — MIT license, source open on GitHub, no ads, no 'pro' version behind a paywall.

Does the plugin send my text to an AI or over the internet?

No. Everything runs locally in Notepad++. You paste the regex you got elsewhere; the plugin shows what it does on your text.

How exact is 'match like Python' or 'like JavaScript'?

Every language runs on the same engine as Notepad++, with that language's settings: anchors, dot, case, POSIX 'longest match' and the syntax differences. For everyday regexes that gives the same matches as the real language; for the rare exception you get a warning instead of a silent difference.

Which languages does it recognise in pasted code?

Python (including pandas .str.*), JavaScript/TypeScript, C#, Java, Kotlin, PHP, Go, Rust, PowerShell, and sed, grep, rg and perl on the command line. Plus markdown code blocks and `inline code`.

Can I use the regex in Find/Replace afterwards?

Yes: 'Copy for Notepad++ Find' copies the converted regex, for example (?<name>…) instead of Python's (?P<name>…).

Which Notepad++ version do I need?

64-bit Notepad++ 8.3 or later. 32-bit is not supported.

Found a bug, or have an idea for an improvement?

Report it directly as an issue on GitHub — it gets read and followed up on. Prefer not to use GitHub? Send us a message through the contact form instead, and we'll pass it along.