Nucleus handler tools › Docs › Checks

An invalid regular expression

Errorno-invalid-regexpA general JavaScript mistake (ESLint's no-invalid-regexp) · Nucleus fails: the handler doesn't load, or the session ends.

Why it matters

This regular expression is invalid: it throws when that line runs.

Example

✗ Wrong

var r = new RegExp("[");

✓ Right

var r = new RegExp("\\[");

How to fix it

Escape the special character, or close the bracket.

Turn it off, or change how it shows

Each check can be shown as an error, warning, info or hint, or turned off. VS Code: "splitscreenme.lint.rules": { "no-invalid-regexp": "off" } in your settings. Notepad++: Plugins › Nucleus Co-op handlers › Settings. Command line: ncdev lint --rule no-invalid-regexp=off. Other editors: the lint.rules setting of ncdev lsp.

Is this right? Tell us what's wrong
Stuck, or not sure? Ask other handler authors: Discordr/nucleuscoop