Use GNU expr if available, avoid shell calls in recursive expansion.