Deep learning based on convolutional neural network (CNN) has been successfully applied to stereo matching, which has achieved greater improvement in speed and accuracy compared with traditional methods. However, existing CNN-based stereo matching frameworks frequently encounter two problems. First, the existing stereo matching network has a large number of parameters, which results in too long matching running time since excessive network width and excessive number of convolution kernels. Second, in some areas where reflection, refraction and fine structure may lead to ill-posed problems, the disparity estimation errors can be occurred. In this paper, we proposed a lightweight network, convolution attention residual network (CAR-Net), which can balance the real-time matching and matching accuracy for stereo matching. Besides, a multi-scale residual network called CBAM-ResNeXt, which combines attention, was proposed for features extraction. With an aim is to simplify the parameters of the network model by reducing the size of filters and to extract the semantic features such as categories and locations from the image through convolutional block attention module (CBAM). Here, the CBAM consists of channel attention module and spatial attention module, where the semantic information of the feature map can be fully maintained after the parameters were simplified. Moreover, we proposed a dimension-extended 3D-CBAM, which is connected to 3DCNN for cost aggregation. By combining these two sub-modules of attention, the network is guided to selectively focus on the foreground or background regions, so as to improve the disparity accuracy in the ill-posed regions. The experimental results showed that our proposed method generated high accuracy and optimized the velocity compared to the state-of-the-art benchmark on KITTI 2012, KITTI 2015 and Scene Flow.