Skip to content

Instantly share code, notes, and snippets.

@maczam79
maczam79 / extract-bible.js
Created October 21, 2018 08:14
Extract book, chapter and verse bible
function parse(text) {
var results = [];
var regex = /([\d ]*)([a-z]+) +([\d,;:-]+)/ig;
while (true) {
try {
var matcher = regex.exec(text);
if (!matcher) return results;
var bookIndex = getBookIndex(matcher);