解决正则问题 1
re.findall(r”([^=]+)=([^%s]+%s?|\Z)” % (re.escape(conf.paramDel or “”)
- re.escape() 什么意思,是干什么的?
Escape all non-alphanumeric characters in pattern
匹配所有的非数字,字母的结果(转义字符的功能)
In [14]: import re
In [15]: s="*&%&$%(&*("
In [16]: t=re.escape(s)
In [17]: print t
\*\&\%\&\$\%\(\&\*\(
----------
re.findall()
Type: function
String form: <function findall at 0x7febc5aa9ed8>
File: /usr/lib/python2.7/re.py
Definition: re.findall(pattern, string, flags=0)
Docstring:
Return a list of all non-overlapping matches in the string.
If one or more groups are present in the pattern, return a
list of groups; this will be a list of tuples if the pattern
has more than one group.
Empty matches are included in the result.