TehShrike / verse-reference-regex

A regular expression that matches Bible verse references and ranges
8 stars 3 forks source link

Support multiple consecutive references when the book or chapter is not explicit #6

Open ArtskydJ opened 1 year ago

ArtskydJ commented 1 year ago

verse-reference-regex does not handle multi-passage references well. For example, given "Exodus 24:3, 7-8; 34:27", it finds Exodus 24:3, but not Exodus 24:7-8, nor Exodus 34:27.

More examples ``` Gn 2:4-5, 7-9, 15-16, 18-19, 21-22 1 Cor 15:22, 45, 47 Gn 12:1-3; 13:14-16; 15:18-21; 17:1-16, 19; 22:16-18 Ex 24:3, 7-8; 34:27; Dt 5:2; 29:12 ``` See also: https://github.com/TehShrike/books-of-the-bible/pull/2 --------

It could be that this request is simply out of scope for this module. This module seems to operate with the assumption that one regex match will result in one passage/range. That would no longer be the case, as one regex match could turn into multiple passages/ranges. (Depending upon implementation.)