[关闭]
@lasdtc 2013-11-18T02:07:09.000000Z 字数 952 阅读 1030

正则表达式

Basic Patterns

Repetition

Leftmost & Largest

  1. #Python
  2. match = re.search(r'i+', 'piigiiii') => found, match.group() == "ii"
  3. match = re.search(r'i+?', 'piigiiii') => found, match.group() == "i"
  4. match = re.search(r'<.*>', '<b>aaa<\b>') => found, match.group() == "<b>aaa<\b>"
  5. match = re.search(r'<.*?>', '<b>aaa<\b>') => found, match.group() == "<b>"

Square Brackets

Lecture

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注