MCPcopy
hub / github.com/agent0ai/agent-zero / skip_ignored_patterns

Function skip_ignored_patterns

helpers/strings.py:26–36  ·  view source on GitHub ↗

Skip characters in `s` that match any pattern in `ignore_patterns` starting from `index`.

(s, index)

Source from the content-addressed store, hash-verified

24 last_matched_i, last_matched_j = 0, 0 # Track the last matched index
25
26 def skip_ignored_patterns(s, index):
27 """Skip characters in `s` that match any pattern in `ignore_patterns` starting from `index`."""
28 while index < len(s):
29 for pattern in ignore_patterns:
30 match = re.match(pattern, s[index:])
31 if match:
32 index += len(match.group(0))
33 break
34 else:
35 break
36 return index
37
38 while i < first_length and j < second_length:
39 # Skip ignored patterns

Callers 1

Calls 1

matchMethod · 0.80

Tested by

no test coverage detected