From b31bfd56733873a7b1b6f275b5c83ddcf4393fde Mon Sep 17 00:00:00 2001 From: kokke Date: Fri, 22 Mar 2013 00:42:28 +0100 Subject: [PATCH] Update exrex.py --- exrex.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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]