for cap_group in self.capture_groups:
key = self._make_key(cap_group)
temp_list = []
for match in matchobjects:
# we only want to add the match for the capture group if the match is not None
for cap_group in self.capture_groups:
key = self._make_key(cap_group)
temp_list = []
for match in matchobjects:
# we only want to add the match for the capture group if the match is not None
- # if temp_list of matches is empty just make that column None
- if len(temp_list)==0:
- temp_dict[key] = None
- # else we put in the list we made in the for-loop above
- else:
- if count_only:
- temp_dict[key] = len(temp_list)
+ # if temp_list of matches is empty just make that column None
+ if len(temp_list)==0:
+ temp_dict[key] = None
+ # else we put in the list we made in the for-loop above