diff --git a/core/modules/filters/regexp.js b/core/modules/filters/regexp.js index d6ab27303..4f8d9a8ee 100644 --- a/core/modules/filters/regexp.js +++ b/core/modules/filters/regexp.js @@ -41,7 +41,11 @@ exports.regexp = function(source,operator,options) { regexpString = regexpString.substr(0,regexpString.length - match[0].length); } } - regexp = new RegExp(regexpString,flags); + try { + regexp = new RegExp(regexpString,flags); + } catch(e) { + return ["" + e]; + } // Process the incoming tiddlers if(operator.prefix === "!") { source(function(tiddler,title) {