MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / extractRegexResult

Function extractRegexResult

lib/core/common.py:3128–3150  ·  view source on GitHub ↗

Returns 'result' group value from a possible match with regex on a given content >>> extractRegexResult(r'a(?P [^g]+)g', 'abcdefg') 'bcdef' >>> extractRegexResult(r'a(?P [^g]+)g', 'ABCDEFG', re.I) 'BCDEF'

(regex, content, flags=0)

Source from the content-addressed store, hash-verified

3126
3127@cachedmethod
3128def extractRegexResult(regex, content, flags=0):
3129 """
3130 Returns 'result' group value from a possible match with regex on a given
3131 content
3132
3133 >>> extractRegexResult(r'a(?P<result>[^g]+)g', 'abcdefg')
3134 'bcdef'
3135 >>> extractRegexResult(r'a(?P<result>[^g]+)g', 'ABCDEFG', re.I)
3136 'BCDEF'
3137 """
3138
3139 retVal = None
3140
3141 if regex and content and "?P<result>" in regex:
3142 if isinstance(content, six.binary_type) and isinstance(regex, six.text_type):
3143 regex = getBytes(regex)
3144
3145 match = re.search(regex, content, flags)
3146
3147 if match:
3148 retVal = match.group("result")
3149
3150 return retVal
3151
3152def extractTextTagContent(page):
3153 """

Callers 15

mainFunction · 0.90
crawlThreadFunction · 0.90
_randomFillBlankFieldsFunction · 0.90
startFunction · 0.90
checkSqlInjectionFunction · 0.90
getPageMethod · 0.90
queryPageMethod · 0.90
decodePageFunction · 0.90
processResponseFunction · 0.90
_comparisonFunction · 0.90
payloadMethod · 0.90
extractPayloadMethod · 0.90

Calls 2

getBytesFunction · 0.90
searchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…