mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-29 23:40:45 +00:00
Thinking about your mail led me to this new push -> Mail follows
This commit is contained in:
parent
9444ef095f
commit
a5d75db8d2
@ -51,19 +51,24 @@ function parseFilterOperation(operators,filterString,p) {
|
|||||||
if(operator.operator === "") {
|
if(operator.operator === "") {
|
||||||
operator.operator = "title";
|
operator.operator = "title";
|
||||||
}
|
}
|
||||||
// Get the operand
|
var rexMatch;
|
||||||
|
// regexp?
|
||||||
if(!operator.indirect && filterString.charAt(p) === "/") {
|
if(!operator.indirect && filterString.charAt(p) === "/") {
|
||||||
// regexp
|
|
||||||
var rex = /^\/((?:[^\\\/]*|\\.))*\/([igm]*)\]/g;
|
var rex = /^\/((?:[^\\\/]*|\\.))*\/([igm]*)\]/g;
|
||||||
var rexMatch = rex.exec(filterString.substring(p));
|
rexMatch = rex.exec(filterString.substring(p));
|
||||||
if(!rexMatch) {
|
if(rexMatch) {
|
||||||
throw "Incomplete regular expression in filter expression";
|
try {
|
||||||
|
operator.regexp = new RegExp(rexMatch[1], rexMatch[2]);
|
||||||
|
}
|
||||||
|
catch(e) {
|
||||||
|
// an error in the regexp -> Will do string matching
|
||||||
|
}
|
||||||
|
operator.operand = filterString.substr(p,rex.lastIndex-1);
|
||||||
|
p += rex.lastIndex;
|
||||||
}
|
}
|
||||||
operator.regexp = new RegExp(rexMatch[1], rexMatch[2]);
|
|
||||||
operator.operand = filterString.substr(p,rex.lastIndex-1);
|
|
||||||
p += rex.lastIndex;
|
|
||||||
}
|
}
|
||||||
else {
|
// Get the operand
|
||||||
|
if(!rexMatch) {
|
||||||
bracketPos = filterString.indexOf(operator.indirect ? "}" : "]",p);
|
bracketPos = filterString.indexOf(operator.indirect ? "}" : "]",p);
|
||||||
if(bracketPos === -1) {
|
if(bracketPos === -1) {
|
||||||
throw "Missing closing bracket in filter expression";
|
throw "Missing closing bracket in filter expression";
|
||||||
|
Loading…
Reference in New Issue
Block a user