<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def scan_full(self, regex, return_string=True, advance_pointer=True):
 """ Match from the current position. If `return_string` is false and a match is found, returns the number of characters matched. 'test ' 5 'stri' 5 4 5 """

        regex = get_regex(regex)
        self.match = regex.match(self.string, self.pos)
        if not self.match:
            return
        if advance_pointer:
            self.pos = self.match.end()
        if return_string:
            return self.match.group(0)
        return len(self.match.group(0))