From 26149592a7023d89ac39cd88285d49f7fd28f71c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Sun, 19 Jan 2020 18:27:43 +0100 Subject: [PATCH] bugfix in filtering (filter by specified fields only) --- cards/list.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cards/list.sh b/cards/list.sh index 80abde8..ce8c1ab 100755 --- a/cards/list.sh +++ b/cards/list.sh @@ -97,16 +97,17 @@ filter_cards(){ while [ "$filter" ]; do f="${filter%%^*}" filter="${filter#*^}" + debug "Filter: $f" case $f in '') break ;; ANY:*) fex="/\n.*(\;[^:]*)?:.*(${f#*:}).*\r?\n/{${fex}}" ;; - NAME:*) fex="/\n(N|FN|NICKNAME)(\;[^:]*)?:.*(${f#*:}).*\r?\n/{${fex}}" + NAME:*) fex="/\n(N|FN|NICKNAME)(\;[^:]*)?:[^\n]*(${f#*:}).*\r?\n/{${fex}}" ;; - STREET:*|ZIP:*) fex="/\nADR(\;[^:]*)?:.*(${f#*:}).*\r?\n/{${fex}}" + STREET:*|ZIP:*) fex="/\nADR(\;[^:]*)?:[^\n]*(${f#*:}).*\r?\n/{${fex}}" ;; - *) fex="/\n${f%%:*}(\;[^:]*)?:.*(${f#*:}).*\r?\n/{${fex}}" + *) fex="/\n${f%%:*}(\;[^:]*)?:[^\n]*(${f#*:}).*\r?\n/{${fex}}" ;; esac done -- 2.39.2