如何运用PYTHON正则表达式的问号?
1、打开JUPYTER NOTEBOOK,新建一个空白的文档。

3、aRegex = re.compile(r'(good)man')search = aReg髫潋啜缅ex.search('You are the best goodman.')search.group()search.group(1)search.group(2)如果我们要找到某个数字是否在某个字符串里面,那么有可能会用到分组,而分组里面有很多不同的方法。

5、search2 = bRegex.search('You are the badman.')search2.group()这个情况下有出现,所以就返回。

7、dRegex = re.compile(r'(C)?8\?')search4 = dRegex.search('The correct number is C8?')search4.group()也可以同时出现。
