diff options
Diffstat (limited to 'django/utils/regex_helper.py')
| -rw-r--r-- | django/utils/regex_helper.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/django/utils/regex_helper.py b/django/utils/regex_helper.py index c8390cc7eb..199b4ea87d 100644 --- a/django/utils/regex_helper.py +++ b/django/utils/regex_helper.py @@ -202,6 +202,7 @@ def normalize(pattern): return list(zip(*flatten_result(result))) + def next_char(input_iter): """ An iterator that yields the next character from "pattern_iter", respecting @@ -222,6 +223,7 @@ def next_char(input_iter): continue yield representative, True + def walk_to_end(ch, input_iter): """ The iterator is currently inside a capturing group. We want to walk to the @@ -242,6 +244,7 @@ def walk_to_end(ch, input_iter): return nesting -= 1 + def get_quantifier(ch, input_iter): """ Parse a quantifier from the input, where "ch" is the first character in the @@ -278,6 +281,7 @@ def get_quantifier(ch, input_iter): ch = None return int(values[0]), ch + def contains(source, inst): """ Returns True if the "source" contains an instance of "inst". False, @@ -291,6 +295,7 @@ def contains(source, inst): return True return False + def flatten_result(source): """ Turns the given source sequence into a list of reg-exp possibilities and |
