---
title: "python__re"
author: "xserver"
date: "2013-03-19T17:49:39Z"
tags: []
categories: ["编程语言"]
slug: "python-re"
draft: false
lastmod: "2013-03-21T17:40:17Z"
id: 1832024
url: "https://xserver.iteye.com/blog/1832024"
---

xpath解析html,使用正则不好...
<http://www.cnblogs.com/sevenyuan/archive/2010/12/06/1898075.html>

re.compile 返回一个正则对象
re.split     分割字符

re.match
re.search  
re.findall  查找全部


\W	匹配任意不是字母，数字，下划线，汉字的字符
\S	匹配任意不是空白符的字符
\D	匹配任意非数字的字符
\B	匹配不是单词开头或结束的位置
	匹配除了x以外的任意字符
	匹配除了aeiou这几个字母以外的任意字符

<http://www.cnblogs.com/deerchao/archive/2006/08/24/zhengzhe30fengzhongjiaocheng.html>