CodeMirror Regex Code Editor Demonstration

The Regex parser for CodeMirror allows syntax coloring on regular expressions with some beginning customizability by Regex flavor/language. For integrating styling of regular expression literals into JavaScript syntax highlighting, see this JavaScript+Regex Demo.

Styling ability is fine-grained, so any token should be distinctly stylable if so desired. Parenthetical groups can be styled with the same styles for inner content, and the script also enables styling by nesting depth and sequence, including by imposing a limit such that styles will alternate.

Information can also be passed on (especially when the parseregex-unicode.js file is included) for use in CodeMirror's activeTokens argument such as demonstrated below by tooltips which show which characters are present in a given range or Unicode class.

Note that this editor does not support free-spacing mode, so it is not recommended to use multiple lines for input, but for demonstration purposes, multiple lines are shown.