I was working on extraction of sub-string from the beginning & at the end of the string. I experimented with and with out .*$expr ab1cd1efgfedcbaAAAA : .*\(1[a-l]*\)  # Result: 1efgfedcba$expr ab1cd1efgfedcbaAAAA : \(1[a-l]*\)    # No Result (1cd was expected)$expr ab1cd1efgfedcbaAAAA : \(ab1[a-l]*\)    # Result: ab1cdWhy did't the 'expr' give result for the second substring search. It can be seen that 'ab' had been prefixed to the substring in the third search. that is the only difference between 2nd and 3rd search. Perhaps i am missing something here. How is the search performed by 'expr' ?
Substring extraction with expr
shell script;regular expression;expr
man expr says the STRING : PATTERN expression is anchored, and then in the the info page (info coreutils 'expr invocation') you can read:`STRING : REGEX'     Perform pattern matching.  The arguments are converted to strings     and the second is considered to be a (basic, a la GNU `grep')     regular expression, with a `^' implicitly prepended.  The first     argument is then matched against this regular expression.Which means the effect you see is expected behavior