With development of the cloud computing, its security issues have got more and more attention. There is a great demand for the examining the content of data or packets in order to improve cloud security. In this paper, we propose a new algorithm about pattern matching for cloud system, First it performs inexact matching to filter out the part of non-attack information and then do exact matching to get the final attack information. Our presented specific algorithm named Bit-Reduced DFA, it is feasible through a preliminary evaluation.