Jelly, 80 70 bytes
Explanation (outdated)
ḢfØDV+2ị=”JƲo1 # HelperHelper link 1: Takes a bible reference and returns which number book should be used that matches the textual part of the reference; half the code is to handle the John letters
Ḣ # Head
fØD # Head
fØD # Keep only digits
V # Keep only digits
V # Evaluate (will be 0 if no digits)
2ị=”JƲ}¡ # Evaluate (will be 0 if no digits)
# If+ the second remaining character isƲ a J:
‘ # Add #the -result Incrementof bythe 1
following, applied to the helper link's original argument
2ị=”J o1 # Or 1 (replaces 0s with ones)
ɠ⁻⁶x8¤$пYœṣ”¶x5¤Ỵ€ # - 1 if the second remaining character is a J, otherwise 0
# Helper link 2: Called niladically, reads theo1 bible from STDIN and splits up into books
ɠ $п # Or 1 (replaces 0s with ones)
Ḳ-ị⁹œṣ”¶x5¤¤Ỵ€¤Ḣw¥Ƈị@Ç{KœṣḲṪ¹⁾1:;$f?”:ʋ2ịwⱮØD;€”:¤œPƊḢḊ # ReadMain lineslink: fromtakes STDINa untilbible thereference followingas isits false:
argument ⁻⁶x8¤and returns the verse
Ḳ # - The read line is not equal to eight spaces
Y# Split at spaces
-ị # Join with newlines
œṣ”¶x5¤ # Penultimate part (will be the last word of the book title)
⁹ # Split at five consecutive newlines
¤ Ỵ€ # Using #the Splitfollowing eachapplied bookto atthe newlines
Ḳ-ị¢Ḣw¥Ƈị@ÑKœṣḲṪ¹⁾1:;$f?”:Ʋ2ịwⱮØD;€”right argument:¤œPƊḢḊ
# Main link:œṣ”¶x5¤¤ takes a bible reference as its argument and returns the verse
Ḳ # - Split at five consecutive newlines
# Split at spaces
-ị Ỵ€ # Penultimate- partSplit (willeach beat thenewlines
last word of the book title)
¢Ḣw¥Ƈ Ḣw¥Ƈ # Keep those books (from helper link# 2)Keep those where the first line containsincludes thisthe asbook atitle sublistword from earlier
ị@Ñ ị@Ç{ # IndexIndex into this using the result of calling the helper link 1 on the original reference (so returning a single book)
K K # JoinJoin atwith spaces
œṣ Ʋ # SplitSplit at the substring determined by calling following on the original reference:
Ḳ Ḳ # - Split at spaces
Ṫ Ṫ # - Tail (i.e. the verse or chapter:verse)
f?”: # - If contains a colon:
¹ ¹ # - Leave as is
⁾1:;$ # - Else: prepend "1:"
2ị 2ị # TakeTake the second part (i.e. the bit immediately after the chapter:verse reference)
Ɗ Ɗ # FollowingFollowing as a monad:
wⱮØD;€”:¤ # - FindFind the position of every sublist that comprises of a digit followed by a colon
œP œP # - And split at these
ḢḊ ḢḊ # TakeTake the first remaining part, and then remove the first character (which will be the space left just after the original chapter:verse marker)
💎