Extract operations now offer built-in Sort and Unique options. Unique operation offers option to count occurances. Closes #1334.

This commit is contained in:
n1474335 2022-04-14 18:08:16 +01:00
parent 6959e2cf01
commit 9a982f05ac
14 changed files with 397 additions and 206 deletions

View file

@ -44,7 +44,13 @@ class ExtractDates extends Operation {
date3 = "(?:0[1-9]|1[012])[- /.](?:0[1-9]|[12][0-9]|3[01])[- /.](?:19|20)\\d\\d", // mm/dd/yyyy
regex = new RegExp(date1 + "|" + date2 + "|" + date3, "ig");
return search(input, regex, null, displayTotal);
const results = search(input, regex);
if (displayTotal) {
return `Total found: ${results.length}\n\n${results.join("\n")}`;
} else {
return results.join("\n");
}
}
}