Skip to content

Jcparkyn/nodexr

Repository files navigation

Nodexr

Test and Deploy License GitHub issues

Nodexr is a node-based Regular Expression editor, created in C# and Blazor.

Try it at nodexr.net

You can also try it out by starting with one of these example expressions:

This screenshot shows a regular expression used to match floating point numbers, with or without an exponent:

Screenshot

Or, one to match an IPv4 address containing 4 integers from 0 to 255:

Screenshot

Features

  • Uses the full .NET Regex engine for search and replace (unlike most online Regex tools).
  • Show the results of search and replace (using the .NET Regex engine) in the browser in realtime.
  • Full syntax highlighting.
  • Hover over sections of the output to see which node they were generated by.
  • The nodes can be used to work with (almost) all of the .NET Regex spec, and any additional functionality can be implemented either by using the Text node without escaping, or with a custom Group node.
  • The node-based approach makes it almost impossible to have syntax errors, missing parentheses etc (except with certain nodes)
  • Enter an existing Regex and it will be parsed into a fully editable node tree (using the Edit button next to the output). This should work with expressions of any complexity level (although there are a couple of niche features that can't yet be parsed properly).
  • Create a shareable link for your expression, to send to someone else or come back to later (this feature currently relies on the expression parsing, so in some cases the node tree will be a little different after sharing - but the expression should be the same).
  • Information about each node can be found by clicking the (i) button next to its title.
  • Automatically deals with non-capturing groups, so you no longer have to think about them in 99% of cases.
  • Runs completely client-side - no communication with a server after the initial page load.

How To Use

Drag-and-drop nodes from the left panel to insert them into the main window. The final result/output of your nodes must be connected to the Output node and is displayed at the top left.

The main concept is that the "nesting" behaviour of regex is expressed by connecting one node to the input of another, but items in sequence are connected using the Previous input at the top left of each node. Expressions can alternatively be connected in sequence (concatenated) using the Concatenate node. The output expression will be empty unless a node is connected to the Output node.

Nodes can be deleted by selecting them with left-click and then pressing Backspace or Delete. You can also select multiple nodes at a time by holding Shift or Ctrl while clicking a node.

Nodes

Information about each node can be found by clicking the (i) button next to its title.

To use any Regex functionality that cannot be implemented with the provided nodes, create a Text node with 'escape' disabled to input parts of the expression manually.

Replacement

Use the panels at the bottom of the screen to test a string for searching and/or replacement. Any valid .NET Regex replacement string can be used here, including named and/or numbered group references. The bottom right panel shows the result after replacement.

Contributing

Any contributions are welcome, but ideally start by creating an issue.

Also check out

A very similar tool called Regex Nodes has been made by Johannes Vollmer. There is no connection between Nodexr and Regex Nodes, but it is a very polished alternative for those that need JavaScript regular expressions.