expr manual page says: “Pattern matches return the string matched between ( and ) or null; if ( and ) are not used, they return the number of characters matched or 0.”
I am doing
echo `expr ABCDEF : ABC`
which gives 3 as expected
However, this also gives 3, why ?
echo `expr \( ABCDEF : ABC \)`
There are two different kinds of parentheses there; the ones you used are part of the expression syntax, whereas your quote is about regular expression parentheses within the pattern.