CodeMirror PCRE mode

This is a CodeMirror mode that brings syntax highlighting for Perl Compatible Regular Expressions (PCRE).

MIME types defined:

Options:

Table of contents:

Use as nested mode

Below are demonstrations of how the PCRE mode can be used to highlight regular expressions within other languages. This first example is an nginx configuration snippet:

This second example is a simple list of one-line regexes with comments:

man pcresyntax

This is a slightly adjusted copy of `man pcresyntax`. This man page reflects most PCRE syntactic structures in a colourful way thanks to CodeMirror and the PCRE mode.

Examples from man pcrepattern

`man pcrepattern` is much longer than `man pcresyntax`, which is why only its examples were reproduced below.

Other details