rc spell: Don't use expr to format-check

The regular pattern based on `printf`/`grep` is cleaner and less
error prone.
This commit is contained in:
Frank LENORMAND 2020-05-15 12:19:29 +03:00
parent b6041e60ac
commit 7db9062122

View File

@ -121,7 +121,7 @@ define-command spell-next %{ evaluate-commands %sh{
}
# no selection descriptions are in `spell_regions`
if ! expr "${start_first}" : '[0-9][0-9]*\.[0-9][0-9]*,[0-9][0-9]*\.[0-9]' >/dev/null; then
if ! printf %s "${start_first}" | grep -qE '^[0-9]+\.[0-9]+,[0-9]+\.[0-9]+$'; then
exit
fi