On Sat 29 Jun 2024 at 17:08:04 (+0200), Vincent Lefevre wrote:
> On 2024-06-28 20:53:50 +0000, Michael Kjörling wrote:
> > Yes, it almost certainly can be done with a single sed (or other
> > similar tool) invocation where the regular expression matches
> > precisely what you want it to match. But unless this is something you
> > will do very often, I tend to prefer readability over being clever,
> > even if the readable version is somewhat less performant.
> 
> To match a range inside a regexp, $(rgxg range 1 119) is readable. :)
> 
> rgxg is provided by the package of the same name.

Perhaps best to ignore the narrow focus on 119 in the OP.
For bible verses per chapter, the largest number is 176.
(An accidental choice of 119 might be explained by that
psalm having the most verses. Only Psalms requires three
digits as it happens; I think the runner-up has only about
half that.)

It would be tedious and error-prone to have to specify the
maximum range for each chapter. Different versions of the
bible don't even agree with each other on numbers of verses.

Cheers,
David.

Reply via email to