The Texinfo documentation is now the authoritative source. This manual page documents the GNU version of expr . Each token of the expression must be a separate argument.
Operands are either numbers or strings.
Strings are not quoted for expr , though you may need to quote them to protect them from the shell. The first argument is then matched against this regular expression. Return the substring of string beginning at position with length at most length . If either position or length is negative or non-numeric, return a null string. If no character in character-class is found in string , return 0.