正在加载图片...
Same for Python Basic search methods for String objects 表示是原始字义 Maton re match(r"tri rin" ,string") → no match/n re. search(r"tril rin","string"). group)o)>tri re compile(rtrilstr").findall("string )>['str re compile(r"rilst ). findall(string >['st,'ri] re search(r"Itr)I(in),string"). groups()>tr None)(()) capful edens note: match("expests the match to start at index oSame for Python • Basic search methods, for String objects: – re.match(r"tri|rin", "string") → no match – re.search(r"tri|rin", "string").group(0) → 'tri' – re.compile(r"tri|str").findall("string") → ['str'] – re.compile(r"ri|st").findall("string") → ['st', 'ri'] – re.search(r"(tr)|(in)", "string").groups() → ('tr', None) • note: match() expects the match to start at index 0 9 表示是原始字义
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有