I have tried to extract a number as given below but nothing is printed on screen:
echo \"This is an example: 65 apples\" | sed -n \'s/.*\\([0-9]*\\) apples/\\1/
echo "This is an example: 65 apples" | ssed -nR -e 's/.*?\b([0-9]*) apples/\1/p'
You will however need super-sed for this to work. The -R allows perl regexp.