diff --git a/README.md b/README.md index d250493..08080c3 100644 --- a/README.md +++ b/README.md @@ -9,5 +9,6 @@ It is possible to - toggle columns - filter rows - negate filter rows with "!" +- filter rows with regex, e. g. /10|15|80/ - select rows with the mouse - download the plan in pdf format diff --git a/band-plan.html b/band-plan.html index 85a3e9a..84aecbc 100644 --- a/band-plan.html +++ b/band-plan.html @@ -103,6 +103,9 @@ div>label { } else { return true; } + } else if (headerValue.startsWith("/") && headerValue.endsWith("/") && (headerValue.length > 1)) { + // filter regex + return RegExp(headerValue.toString().slice(1).slice(0,-1)).test(rowValue); } else { // filter normal if (typeof rowValue !== "undefined") { @@ -437,7 +440,7 @@ div>label { "Base plan, regulation and css: use your own files for the band plan and css, URLs are possible, CORS needs to be allowed for the files, download standard files for examples\n" + "When Regulation is empty, all frequencies from base plan will be included\n" + "When CSS is empty or URL not available, colors, etc. will be gone\n" - + "Filter rows with text in column headings, use filter starting with \"!\" as exclusion\n" + + "Filter rows with text in column headings, use filter starting with \"!\" as exclusion, use filter with // as regex, e. g. /10|15|80/\n" + "Download list: saves .pdf of the current list (selection of rows apply)\n" + "Selection of rows with mouse possible\n" + "Download plans/css: get the yml and css files\n"