1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 02:19:55 +00:00

Fix regexp performance problem introduced in c7b31b0242

This fixes a problem introduced in
c7b31b0242.

The changes by @tobibeer inadvertently made the regular expression
evaluation significantly more expensive because of lookahead. The is
less elegant but reverts the performance problem.
This commit is contained in:
Jermolene 2016-10-17 19:08:01 +01:00
parent 537cfcbf79
commit accd4a1b65

View File

@ -19,9 +19,9 @@ exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = new RegExp(
"~?\\$:\\/(?:" +
$tw.config.textPrimitives.anyLetter +
"|[\/._-])+",
"~?\\$:\\/[" +
$tw.config.textPrimitives.anyLetter.substr(1,$tw.config.textPrimitives.anyLetter.length - 2) +
"\/._-]+",
"mg"
);
};