@@ -1424,19 +1424,19 @@ def goGoodSamaritan(prevValue, originalCharset):
14241424 else :
14251425 return None , None , None , originalCharset
14261426
1427- def getCompiledRegex (regex , * args ):
1427+ def getCompiledRegex (regex , flags = 0 ):
14281428 """
14291429 Returns compiled regular expression and stores it in cache for further
14301430 usage
14311431 >>> getCompiledRegex('test') # doctest: +ELLIPSIS
14321432 <_sre.SRE_Pattern object at...
14331433 """
14341434
1435- if (regex , args ) in kb .cache .regex :
1436- return kb .cache .regex [(regex , args )]
1435+ if (regex , flags ) in kb .cache .regex :
1436+ return kb .cache .regex [(regex , flags )]
14371437 else :
1438- retVal = re .compile (regex , * args )
1439- kb .cache .regex [(regex , args )] = retVal
1438+ retVal = re .compile (regex , flags )
1439+ kb .cache .regex [(regex , flags )] = retVal
14401440 return retVal
14411441
14421442def getPartRun ():
@@ -1628,11 +1628,11 @@ def getPublicTypeMembers(type_):
16281628
16291629 return retVal
16301630
1631- def extractRegexResult (regex , content ):
1631+ def extractRegexResult (regex , content , flags = 0 ):
16321632 retVal = None
16331633
16341634 if regex and content and '?P<result>' in regex :
1635- match = re .search (regex , content )
1635+ match = re .search (regex , content , flags )
16361636 if match :
16371637 retVal = match .group ("result" )
16381638
0 commit comments