diff --git a/exrex.py b/exrex.py index e39adf9..cbb5895 100644 --- a/exrex.py +++ b/exrex.py @@ -119,7 +119,7 @@ def _gen(d, limit=20, count=False): ret = comb(ret, subs) elif i[0] == 'max_repeat': chars = filter(None, _gen(list(i[1][2]), limit)) - if i[1][1]+1 - i[1][0] > limit: + if i[1][1]+1 - i[1][0] >= limit: ran = range(i[1][0], i[1][0]+limit) else: ran = range(i[1][0], i[1][1]+1) @@ -170,7 +170,7 @@ def _randone(d, limit=20): ret += choice(CATEGORIES['category_any']) elif i[0] == 'max_repeat': chars = filter(None, _gen(list(i[1][2]), limit)) - if i[1][1]+1 - i[1][0] > limit: + if i[1][1]+1 - i[1][0] >= limit: min,max = i[1][0], i[1][0]+limit else: min,max = i[1][0], i[1][1]