__init__ (
self,
expression,
min_count=0,
max_count=MAXREPEAT,
)
(expression, min_count = 0, max_count = MAXREPEAT)
Match the expression at least min_count times and no more
than max_count times. If max_count == MAXREPEAT then
there is no fixed upper limit.
min_count and max_count can be strings, in which case they are
used as "named group repeats." That is, they are taken to be
group names and used to find the repeat counts during
evaluation time. The current implementation only understands
named group repeats when min_count == max_count.
The grouping is greedy.
WARNING: There is no check to ensure that a match of 0 size is
repeated indefinitely, as with "(a?)*" against the string "b".
This will loop forever.
WARNING: The current implementation does not support
backtracking in MaxRepeats, so ".
" will not match "
".
Use a more explicit construct instead, like "[^
]
".
|