]> git.plutz.net Git - serve0/blobdiff - list.sh
alliw text search (and exclusion) in advfilter
[serve0] / list.sh
diff --git a/list.sh b/list.sh
index 6c09a43ad4983c216666384e77445f0b241d802f..60609b62c2f26c05dbeef788979d163ac0c178c3 100644 (file)
--- a/list.sh
+++ b/list.sh
@@ -51,10 +51,14 @@ list_item() {
   STRING "$FILTER^" \
   | sed -E 's;\^;\n;g; s;[]\/\(\)\\\^\$\?\.\+\*\;\[\{\}];\\&;g' \
   | while read -r f; do
-    [ "${f#\~}" ] || continue
-    [ "${f#\~}" = "$f" ] \
-    && fex="/(\ttags=([^\t]*,)?)(${f})((,[^\t]*)?\t)/{${fex}}" \
-    || fex="/(\ttags=([^\t]*,)?)(${f#\~})((,[^\t]*)?\t)/d; ${fex}"
+    [ "${f##*[A-Z]*}" ] && tl="y;ABCDEFGHIJKLMNOPQRSTUVWXYZ;abcdefghijklmnopqrstuvwxyz;;"
+    case $f in
+      ''|~) continue;;
+      ~\\\$:*) fex="h; ${tl} /${f#~\\\$:}/d; g;${fex}";;
+      \\\$:*) fex="h; ${tl} /${f#\\\$:}/{g;${fex}}";;
+      ~*) fex="/(\ttags=([^\t]*,)?)(${f#\~})((,[^\t]*)?\t)/d; ${fex}";;
+       *) fex="/(\ttags=([^\t]*,)?)(${f})((,[^\t]*)?\t)/{${fex}}";;
+    esac
     printf '%s\n' "${fex}"
   done \
   | tail -n1