/* * Check that builtin character classes within ranges produce syntax * errors. * * Note: /\b/ is the backspace escape, which is a single pattern character, * though it looks deceptively like a character class.
*/
function isRegExpSyntaxError(pattern) { try { var re = new RegExp(pattern);
} catch (e) { if (e instanceof SyntaxError) returntrue;
} returnfalse;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.