BF: Allow handle case when SKIPLINES lines is not matched

Example is when one or more SKIPLINES is optional in a regex
pull/476/head
Steven Hiscocks 2013-12-04 23:13:27 +00:00
parent c886414e2e
commit c03a50b44b
1 changed files with 2 additions and 1 deletions

View File

@ -133,7 +133,8 @@ class Regex:
n = 0
while True:
try:
skippedLines += self._matchCache.group("skiplines%i" % n)
if self._matchCache.group("skiplines%i" % n) is not None:
skippedLines += self._matchCache.group("skiplines%i" % n)
n += 1
except IndexError:
break