else
printf '^%s:%s' "$filter_type" "$filter_text"
fi
- done | sed -r \
+ done | sed -E \
's;\|+;\|;g; s;\^+;\^;g; s;:\|;:;g;
:X; s;\^[^:]*:\^;\^;g; /\^[^:]*:\^/bX;
s;^\^;;; s;\^[^:]*:$;;;'
printf '%s\n' "$cardfile"
cat "$cardfile"
done \
- | sed -En ':X; /\nEND:VCARD\r?$/!{ N; bX; }; h; s;\n.*$;;; x; s;^[^\n]+\n;;;
+ | sed -nE ':X; /\nEND:VCARD\r?$/!{ N; bX; }; h; s;\n.*$;;; x; s;^[^\n]+\n;;;
'"$upcase""$fex"
}
if [ "$(POST add)" = "add" ]; then
printf %s\\n "$newcat" >>"$catfile"
elif [ "$remove" ]; then
- sed -Ei '/^'"${remove}"'$/d' "$catfile"
+ sed -E -i '/^'"${remove}"'$/d' "$catfile"
fi
REDIRECT "/categories/"
n=1; while cardcats="${cardcats}${cardcats:+,}$(pdi_value "$vcf" CATEGORIES $n)"; do n=$((n+1)); done
if [ "${postcats}" != "${cardcats}" ] && LOCK "$card"; then
- sed -ri '
+ sed -E -i '
/^CATEGORIES[;:]/d
/^END;?:VCARD *\r?$/iCATEGORIES:'"${postcats%,}"'\r
' "${card}"
cat "${_DATA}/vcard/${card}"
done \
| pdi_load - \
- | sed -rn 's;^EMAIL(\;[^:]*)*:(.+)\r?$;\2,;p' \
+ | sed -nE 's;^EMAIL(\;[^:]*)*:(.+)\r?$;\2,;p' \
| tr -d \\n \
| unescape
}
REDIRECT "/courses/?e=${course}"
;;
addfield\ [A-Z]*)
- newfield="$(POST action |sed -rn '1s;^addfield ([A-Z][A-Z0-9-]*)$;\1;p')"
+ newfield="$(POST action |sed -nE '1s;^addfield ([A-Z][A-Z0-9-]*)$;\1;p')"
ics="$(pdi_update_value "$ics" "$newfield" $(( $(pdi_count "$ics" "$newfield") + 1 )) '')"
printf '%s' "$ics" |grep -vx '' >"$tempfile"
REDIRECT "/courses/?e=${course}"
grep -F "${course} " "$attfile" |while read junk card; do
touch "$_DATA/vcard/${card}"
done
- sed -i -r "/^${course} .+\$/d" "$attfile"
+ sed -E -i "/^${course} .+\$/d" "$attfile"
seq 1 $(POST_COUNT attendance) |while read n; do
printf '%s %s\n' "$course" "$(POST attendance $n)"
done >>"$attfile"
}
cal_date(){
- { [ $# -eq 0 ] && cat || printf %s "$*"; } |sed -rnE '
+ { [ $# -eq 0 ] && cat || printf %s "$*"; } |sed -nE '
2q
s/^([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2})([0-9]{2})([0-9]{2})Z$/\1-\2-\3 \4:\5:\6 UTC/p;t
s/^TZID=(.+)\:([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2})([0-9]{2})([0-9]{2})$/TZ="\1" \2-\3-\4 \5:\6:\7/p;t
local dstart="${dtstart##*-}"; dstart="${dstart%% *}"
local rrule="$(pdi_value "$course" RRULE)"
- local rr_int="$(printf %s "$rrule" |sed -rn 's;^(.*\;[ ]*)?INTERVAL=([0-9]+)(\;.*)?$;\2;p')"
- local rr_count="$(printf %s "$rrule" |sed -rn 's;^(.*\;[ ]*)?COUNT=([0-9]+)(\;.*)?$;\2;p')"
- local rr_freq="$(printf %s "$rrule" |sed -rn 's;^(.*\;[ ]*)?FREQ=(DAILY|WEEKLY|MONTHLY|YEARLY)(\;.*)?$;\2;p')"
- local rr_until="$(printf %s "$rrule" |sed -rn 's;^(.*\;[ ]*)?UNTIL=([0-9]{8}T[0-9]{6}Z)(\;.*)?$;\2;p')"
+ local rr_int="$(printf %s "$rrule" |sed -nE 's;^(.*\;[ ]*)?INTERVAL=([0-9]+)(\;.*)?$;\2;p')"
+ local rr_count="$(printf %s "$rrule" |sed -nE 's;^(.*\;[ ]*)?COUNT=([0-9]+)(\;.*)?$;\2;p')"
+ local rr_freq="$(printf %s "$rrule" |sed -nE 's;^(.*\;[ ]*)?FREQ=(DAILY|WEEKLY|MONTHLY|YEARLY)(\;.*)?$;\2;p')"
+ local rr_until="$(printf %s "$rrule" |sed -nE 's;^(.*\;[ ]*)?UNTIL=([0-9]{8}T[0-9]{6}Z)(\;.*)?$;\2;p')"
local rr_uyear="${rr_until%????T??????Z}"
local rr_umonth=${rr_until#????}; rr_umonth="${rr_umonth%??T??????Z}"
local rr_uday=${rr_until#??????}; rr_uday="${rr_uday%T??????Z}"