CodeMirror PCRE mode
How to use
pcre.css at adequate locations in your HTML structure.
mode: 'pcre' when creating your CodeMirror instance.
codemirror-mode-pcre supports extended mode (
x flag) and actually enables it by default. This can be turned off by passing
extended: false when creating the CodeMirror instance.
This mode does not leverage CodeMirror's default tokens (they are not exactly fitted for regular expressions). Consequently, if you use a theme other than the default one, you will likely want to write your own
codemirror-mode-pcre can be nested within another mode, i.e. it can highlight regular expressions for another mode. This requires adjusting the other mode though. See the demo page for an example of such nesting.
codemirror-mode-pcre does not offer:
- completion (e.g. suggesting POSIX class names or script names for
- tooltips reflecting what the various parts of an expression actually mean;
- support for fancy module loaders.
Those may come in the future though.
Like the PCRE library, this mode is released under the 3-clause BSD license.