正则表达式里面哪些字符需要转义需要转义的字符有:\ . * ^ & [ ] { } ? 等建议看一下这篇基础文章。http://deerchao.net/tutorials/regex/regex-1.htm