Overlapping matches with finditer() in Python
I'm using a regex to match Bible verse references in a text. The current regex is REF_REGEX = re.compile(''' (?<!\w) # Not preceded by any words (?P<quote>q(?:uote)?\s+)? # Match optional 'q' or 'quote' followed by many spaces (?P<book> (?:(?:[1-3]|I{1,3})\s*)? # Match an optional arabic or roman number between 1 and 3. [A-Za-z]+ # Match any alphabetics )\.? # Followed by an optional dot (?: \s*(?P<chapter>\d+) # Match the chapter number (?: [:\.](?P<startverse>\d+) # Match the starting verse number, preceded by ':' or '.' (?:-(?P<endverse>\d+))? # Match the optional ending verse number,