From: Paul Hänsch Date: Wed, 18 Jul 2018 06:42:11 +0000 (+0200) Subject: improved regex search X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=5ae0bc5587a5769253c3244ae6a4574f66495376;p=serve0 improved regex search --- diff --git a/list.sh b/list.sh index e8b7075..a2dcd55 100644 --- a/list.sh +++ b/list.sh @@ -77,9 +77,12 @@ list_filemeta(){ | if [ "$FILTER" ]; then sed -nr "$list_fex" elif [ "${SEARCH#!}" != "${SEARCH}" ]; then - grep -aviE "$(STRING "${SEARCH#!}" |sed -r 's;((^|[^\\])(\\\\)*)\+;\1\\+;g;')" + grep -aviE "$(STRING "${SEARCH#!}" |sed -r ':x s;((^|[^\\])(\\\\)*)\+;\1\\+;g; tx;')" else - grep -aiE "$(STRING "${SEARCH}" |sed -r 's;((^|[^\\])(\\\\)*)\+;\1\\+;g;')" + grep -aiE "$(STRING "${SEARCH}" \ + | sed -r ':x s;((^|[^\\])(\\\\)*)\+;\1 ;g; tx; + s;((^|[^\\])(\\\\)*)\\\+;\1+;g; + s; ;\\+;g;')" fi |cut -f6 | UNSTRING \ | while read -r fn; do printf '%s\n' "${base}/${fn%${CR}}"