Wiki Question for Jarod and Thrombomodulin

Post Reply
User avatar
Perry
Posts: 328
Joined: Thu Jan 13, 2011 1:24 pm

Wiki Question for Jarod and Thrombomodulin

Post by Perry » Wed Sep 05, 2012 5:35 pm

Guys,
I've been posting a good deal of new information on the wiki, as well as writing other stuff, that, though not yet posted, may well find it's way there eventually.

In an earlier thread we discuss the idea that we could make this stuff searchable by scripture reference. The question i have for you guys is whether there is an established way that I should be keying the scripture references? If so what is it? If not, we should probably develop one. I'm sure that the way I'm keying things now is not at all friendly to any kind of scripting tools that you guys would like to use/write to accomplish that.

Here's an example:

http://theos.org/wiki/index.php/Revelation_Chapter_4

User avatar
look2jesus
Posts: 180
Joined: Mon Oct 20, 2008 10:18 pm
Location: Mesa, Arizona

Re: Wiki Question for Jarod and Thrombomodulin

Post by look2jesus » Wed Sep 05, 2012 7:20 pm

You never said you were a computer geek! Hey buddy!
And it is my prayer that your love may abound more and more, with knowlege and discernment...Philippians 1:9 ESV

thrombomodulin
Posts: 431
Joined: Sun Aug 24, 2008 6:59 am

Re: Wiki Question for Jarod and Thrombomodulin

Post by thrombomodulin » Wed Sep 05, 2012 8:22 pm

In the old code, the match happened basically in two parts:

A) Identify something that looks like a book-of-the-bible name (case insensitive), followed by whitespace, then a number.
B) Starting with the number after the bible-book name, try to make sense out of numbers, dashes, colons, etc,.

PART "A" - The patterns for "A" are regular expressions as shown in the code block below, basically they all look for a chacter which is not a number (0-9) or letter (a-zA-Z), followed by a fixed string, followed zero or more white space, followed by a number (0-9). A period might or might not be after the abbreviated book name. Of course, the pattern list can be ammended as necessary.

Examples in "A" which do or don't match:
  • "Revelation 5" - MATCH
  • "Revela 5" - NO MATCH
  • "Rev. 5" - MATCH
  • "4Rev. 5" - NO MATCH
  • "Qrevelation 5" - NO MATCH
  • ";Rev. 5" - MATCH
  • "ii thes 3" - MATCH
  • "ii. thes 3" - NO MATCH

Code: Select all


struct pattern_s {
  char         *pattern ;
  int           book_id ;
#define MODE_BOOK    0x001
#define MODE_CHAPTER 0x002
#define MODE_VERSE   0x004
  int           mode_submatch ;
  regex_t       preg[1] ;
  } books[] = {
  {"[^0-9a-zA-Z]revelation *([0-9]+)"                 , BOOK_REVELATION     , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]rev\.* *([0-9]+)"                    , BOOK_REVELATION     , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]jude *([0-9]+)"                       , BOOK_JUDE           , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]iii *john *([0-9]+)"                  , BOOK_3JOHN          , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]3 *john *([0-9]+)"                    , BOOK_3JOHN          , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]ii *john *([0-9]+)"                   , BOOK_2JOHN          , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]2 *john *([0-9]+)"                    , BOOK_2JOHN          , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]i *john *([0-9]+)"                    , BOOK_1JOHN          , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]1 *john *([0-9]+)"                    , BOOK_1JOHN          , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]ii *peter *([0-9]+)"                  , BOOK_2PETER         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]2 *peter *([0-9]+)"                   , BOOK_2PETER         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]i *peter *([0-9]+)"                   , BOOK_1PETER         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]1 *peter *([0-9]+)"                   , BOOK_1PETER         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]james *([0-9]+)"                      , BOOK_JAMES          , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]hebrews *([0-9]+)"                    , BOOK_HEBREWS        , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]heb\.* *([0-9]+)"                    , BOOK_HEBREWS        , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]philemon *([0-9]+)"                   , BOOK_PHILEMON       , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]phil\.* *([0-9]+)"                   , BOOK_PHILEMON       , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]phil\.* *([0-9]+)"                   , BOOK_PHILEMON       , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]titus *([0-9]+)"                      , BOOK_TITUS          , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]ii *timothy *([0-9]+)"                , BOOK_2TIMOTHY       , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]ii *tim\.* *([0-9]+)"                , BOOK_2TIMOTHY       , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]2 *timothy *([0-9]+)"                 , BOOK_2TIMOTHY       , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]2 *tim\.* *([0-9]+)"                 , BOOK_2TIMOTHY       , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]i *timothy *([0-9]+)"                 , BOOK_1TIMOTHY       , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]i *tim\.* *([0-9]+)"                 , BOOK_1TIMOTHY       , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]1 *timothy *([0-9]+)"                 , BOOK_1TIMOTHY       , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]1 *tim\.* *([0-9]+)"                 , BOOK_1TIMOTHY       , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]ii *thessalonians *([0-9]+)"          , BOOK_2THESSALONIANS , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]ii *thess\.* *([0-9]+)"              , BOOK_2THESSALONIANS , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]ii *thes\.* *([0-9]+)"               , BOOK_2THESSALONIANS , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]2 *thessalonians *([0-9]+)"           , BOOK_2THESSALONIANS , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]2 *thes\.* *([0-9]+)"                , BOOK_2THESSALONIANS , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]i *thessalonians *([0-9]+)"           , BOOK_1THESSALONIANS , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]i *thes\.* *([0-9]+)"                , BOOK_1THESSALONIANS , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]1 *thessalonians *([0-9]+)"           , BOOK_1THESSALONIANS , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]1 *thes\.* *([0-9]+)"                , BOOK_1THESSALONIANS , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]colossians *([0-9]+)"                 , BOOK_COLOSSIANS     , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]col\.* *([0-9]+)"                    , BOOK_COLOSSIANS     , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]philippians *([0-9]+)"                , BOOK_PHILIPPIANS    , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]phil\.* *([0-9]+)"                   , BOOK_PHILIPPIANS    , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]ephesians *([0-9]+)"                  , BOOK_EPHESIANS      , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]eph\.* *([0-9]+)"                    , BOOK_EPHESIANS      , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]galatians *([0-9]+)"                  , BOOK_GALATIANS      , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]gal\.* *([0-9]+)"                    , BOOK_GALATIANS      , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]ii *corinthians *([0-9]+)"            , BOOK_2CORINTHIANS   , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]ii *cor\.* *([0-9]+)"                , BOOK_2CORINTHIANS   , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]2 *corinthians *([0-9]+)"             , BOOK_2CORINTHIANS   , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]2 *cor\.* *([0-9]+)"                 , BOOK_2CORINTHIANS   , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]i *corinthians *([0-9]+)"             , BOOK_1CORINTHIANS   , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]i *cor\.* *([0-9]+)"                 , BOOK_1CORINTHIANS   , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]1 *corinthians *([0-9]+)"             , BOOK_1CORINTHIANS   , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]1 *cor\.* *([0-9]+)"                 , BOOK_1CORINTHIANS   , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]romans *([0-9]+)"                     , BOOK_ROMANS         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]rom\.* *([0-9]+)"                    , BOOK_ROMANS         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]acts *([0-9]+)"                       , BOOK_ACTS           , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]john *([0-9]+)"                       , BOOK_JOHN           , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]luke *([0-9]+)"                       , BOOK_LUKE           , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]mark *([0-9]+)"                       , BOOK_MARK           , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]matthew *([0-9]+)"                    , BOOK_MATTHEW        , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]matt\.* *([0-9]+)"                   , BOOK_MATTHEW        , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]malachi *([0-9]+)"                    , BOOK_MALACHI        , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]mal\.* *([0-9]+)"                    , BOOK_MALACHI        , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]zechariah *([0-9]+)"                  , BOOK_ZECHARIAH      , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]zech\.* *([0-9]+)"                   , BOOK_ZECHARIAH      , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]haggai *([0-9]+)"                     , BOOK_HAGGAI         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]hag\.* *([0-9]+)"                    , BOOK_HAGGAI         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]zephaniah *([0-9]+)"                  , BOOK_ZEPHANIAH      , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]zeph\.* *([0-9]+)"                   , BOOK_ZEPHANIAH      , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]habakkuk *([0-9]+)"                   , BOOK_HABAKKUK       , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]hab\.* *([0-9]+)"                    , BOOK_HABAKKUK       , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]nahum *([0-9]+)"                      , BOOK_NAHUM          , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]micah *([0-9]+)"                      , BOOK_MICAH          , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]jonah *([0-9]+)"                      , BOOK_JONAH          , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]jon\.* *([0-9]+)"                    , BOOK_JONAH          , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]obadiah *([0-9]+)"                    , BOOK_OBADIAH        , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]amos *([0-9]+)"                       , BOOK_AMOS           , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]joel *([0-9]+)"                       , BOOK_JOEL           , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]hosea *([0-9]+)"                      , BOOK_HOSEA          , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]daniel *([0-9]+)"                     , BOOK_DANIEL         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]ezekiel *([0-9]+)"                    , BOOK_EZEKIEL        , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]eze\.* *([0-9]+)"                    , BOOK_EZEKIEL        , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]lamentations *([0-9]+)"               , BOOK_LAMENTATIONS   , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]lam\.* *([0-9]+)"                    , BOOK_LAMENTATIONS   , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]jeremiah *([0-9]+)"                   , BOOK_JEREMIAH       , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]jer\.* *([0-9]+)"                    , BOOK_JEREMIAH       , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]isaiah *([0-9]+)"                     , BOOK_ISAIAH         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]isa\.* *([0-9]+)"                    , BOOK_ISAIAH         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]songofsolomon *([0-9]+)"              , BOOK_SONGOFSOLOMON  , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]sos\.* *([0-9]+)"                    , BOOK_SONGOFSOLOMON  , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]ecclesiastes *([0-9]+)"               , BOOK_ECCLESIASTES   , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]ecc\.* *([0-9]+)"                    , BOOK_ECCLESIASTES   , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]proverbs *([0-9]+)"                   , BOOK_PROVERBS       , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]prov\.* *([0-9]+)"                   , BOOK_PROVERBS       , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]psalm *([0-9]+)"                      , BOOK_PSALM          , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]ps\.* *([0-9]+)"                     , BOOK_PSALM          , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]job *([0-9]+)"                        , BOOK_JOB            , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]esther *([0-9]+)"                     , BOOK_ESTHER         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]est\.* *([0-9]+)"                    , BOOK_ESTHER         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]nehemiah *([0-9]+)"                   , BOOK_NEHEMIAH       , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]neh\.* *([0-9]+)"                    , BOOK_NEHEMIAH       , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]ezra *([0-9]+)"                       , BOOK_EZRA           , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]ii *chronicles *([0-9]+)"             , BOOK_2CHRONICLES    , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]ii *chr\.* *([0-9]+)"                , BOOK_2CHRONICLES    , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]2 *chronicles *([0-9]+)"              , BOOK_2CHRONICLES    , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]2 *chr\.* *([0-9]+)"                 , BOOK_2CHRONICLES    , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]i *chronicles *([0-9]+)"              , BOOK_1CHRONICLES    , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]i *chr\.* *([0-9]+)"                 , BOOK_1CHRONICLES    , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]1 *chronicles *([0-9]+)"              , BOOK_1CHRONICLES    , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]1 *chr\.* *([0-9]+)"                 , BOOK_1CHRONICLES    , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]ii *kings *([0-9]+)"                  , BOOK_2KINGS         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]2 *kings *([0-9]+)"                   , BOOK_2KINGS         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]i *kings *([0-9]+)"                   , BOOK_1KINGS         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]1 *kings *([0-9]+)"                   , BOOK_1KINGS         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]ii *samuel *([0-9]+)"                 , BOOK_2SAMUEL        , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]ii *sam\.* *([0-9]+)"                , BOOK_2SAMUEL        , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]2 *samuel *([0-9]+)"                  , BOOK_2SAMUEL        , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]2 *sam\.* *([0-9]+)"                 , BOOK_2SAMUEL        , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]i *samuel *([0-9]+)"                  , BOOK_1SAMUEL        , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]i *sam\.* *([0-9]+)"                 , BOOK_1SAMUEL        , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]1 *samuel *([0-9]+)"                  , BOOK_1SAMUEL        , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]1 *sam\.* *([0-9]+)"                 , BOOK_1SAMUEL        , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]ruth *([0-9]+)"                       , BOOK_RUTH           , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]judges *([0-9]+)"                     , BOOK_JUDGES         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]jud\.* *([0-9]+)"                    , BOOK_JUDGES         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]joshua *([0-9]+)"                     , BOOK_JOSHUA         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]josh\.* *([0-9]+)"                   , BOOK_JOSHUA         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]deuteronomy *([0-9]+)"                , BOOK_DEUTERONOMY    , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]deut\.* *([0-9]+)"                   , BOOK_DEUTERONOMY    , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]numbers *([0-9]+)"                    , BOOK_NUMBERS        , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]num\.* *([0-9]+)"                    , BOOK_NUMBERS        , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]leviticus *([0-9]+)"                  , BOOK_LEVITICUS      , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]lev\.* *([0-9]+)"                    , BOOK_LEVITICUS      , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]exodus *([0-9]+)"                     , BOOK_EXODUS         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]exe\.* *([0-9]+)"                    , BOOK_EXODUS         , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]genesis *([0-9]+)"                    , BOOK_GENESIS        , MODE_BOOK|MODE_CHAPTER ,},
  {"[^0-9a-zA-Z]gen\.* *([0-9]+)"                    , BOOK_GENESIS        , MODE_BOOK|MODE_CHAPTER ,},
  };
PART "B" tries to parse the stuff following the book name into the form of four integers. If a span is not being referenced, the ending chapter and ending verse are set to zero.
  • Starting Chapter
  • Starting Verse
  • Ending Chapter
  • Ending Verse
I could post the actual source code, but I don't think it would do you much good. Rather, demonstrating by example, here's the results followed by the original string in single quotes. Notice a single 'string' might produce multiple 'hits'. The Ruth reference is a good example of this, as well as, how what follows the semicolon is assumed to be a chapter reference, and what follows a colon is assumed to be verse reference.

Code: Select all

Hebrews                          7: 20 -   8:  6 results from 'Hebrews 7:20-8:6 '
I Timothy                        2:  5 -   0:  0 results from '1 Timothy 2:5'
Colossians                       1: 18 -   0:  0 results from 'Colossians 1:18'
Ephesians                        1: 21 -   0:  0 results from 'Ephesians 1:21,'
Acts                            15:  0 -   0:  0 results from 'Acts 15'
Galatians                        2:  0 -   0:  0 results from 'Galatians 2'
I Corinthians                    5:  0 -   0:  0 results from '1 Corinthians 5'
Matthew                         18:  0 -   0:  0 results from 'Matthew 18'
Titus                            2: 13 -   0:  0 results from 'Titus 2:13'
Matthew                          5:  0 -   0:  0 results from 'Matthew 5'
Matthew                          6: 14 -   6: 15 results from 'Matthew 6:14-15 '
Hebrews                         12: 14 -   0:  0 results from 'Hebrews 12:14 '
Luke                             6: 20 -   0:  0 results from 'Luke 6:20'
Luke                             6: 20 -   0:  0 results from 'Luke 6:20 '
Isaiah                          66:  1 -  66:  2 results from 'Isaiah 66:1-2 '
Isaiah                          57: 15 -   0:  0 results from 'Isaiah 57:15 '
Isaiah                          66:  1 -  66:  2 results from 'Isaiah 66:1-2 '
Luke                            14:  0 -   0:  0 results from 'Luke 14 '
Luke                            14: 12 -  14: 14 results from 'Luke 14:12-14 '
Romans                          12:  3 -   0:  0 results from 'Rom 12:3 '
Acts                             7:  0 -   0:  0 results from 'Acts 7 '
Acts                             7:  0 -   0:  0 results from 'Acts 7'
Genesis                         46: 34 -   0:  0 results from 'Gen 46:34 '
Exodus                           3: 11 -   0:  0 results from 'Exodus 3:11 '
Psalm                            8:  3 -   8:  4 results from 'Psalm 8:3-4 '
Luke                            14: 11 -   0:  0 results from 'Luke 14:11 '
Revelation                       2:  9 -   0:  0 results from 'Rev 2:9 '
Revelation                       3: 17 -   0:  0 results from 'Rev. 3:17 '
Luke                            18:  9 -  18: 14 results from 'Luke 18:9-14  '
Luke                            14:  0 -   0:  0 results from 'Luke 14 '
Philippians                      3:  0 -   0:  0 results from 'Philippians 3 '
I Corinthians                    4:  7 -   0:  0 results from '1 Cor 4:7 - '
II Corinthians                  10: 12 -   0:  0 results from '2 Cor. 10:12 - '
Romans                          12:  3 -   0:  0 results from 'Romans 12:3, '
II Corinthians                   4:  7 -   0:  0 results from '2 Cor. 4:7'
Ephesians                        2: 11 -   2: 22 results from 'Eph 2:11-22'
Galatians                        6: 16 -   0:  0 results from 'Gal 6:16'
Galatians                        3: 29 -   0:  0 results from 'Gal 3:29, 2'
Galatians                        3:  2 -   0:  0 results from 'Gal 3:29, 2'
John                            10: 16 -   0:  0 results from 'John 10:16'
John                             8: 31 -   8: 32 results from 'John 8:31-32'
John                             8: 31 -   8: 32 results from 'John 8:31-32'
Hebrews                          8:  0 -   0:  0 results from 'Heb 8'
Titus                            2: 13 -   0:  0 results from 'Titus 2:13'
Isaiah                          11: 11 -   0:  0 results from 'Isaiah 11:11 '
I Corinthians                   10:  1 -  10:  6 results from '1 Cor.10:1-6'
Luke                             9: 31 -   0:  0 results from 'Luke 9:31'
Hebrews                         12: 22 -  12: 23 results from 'Heb.12:22-23'
John                             3: 36 -   0:  0 results from 'John 3:36, '
Galatians                        6: 15 -   6: 16 results from 'Galatians 6:15-16 '
Galatians                        6: 12 -   6: 13 results from 'Galatians 6:12-13, '
Galatians                        2: 16 -   0:  0 results from 'Galatians 2:16, '
John                             3:  6 -   0:  0 results from 'John 3:6, '
Acts                            18:  0 -   0:  0 results from 'Acts 18'
I Corinthians                    1:  0 -   0:  0 results from '1 Cor 1'
Galatians                        2:  0 -   0:  0 results from 'Galatians 2 '
Hebrews                         13: 23 -   0:  0 results from 'Heb.13:23'
Galatians                        2:  0 -   0:  0 results from 'Galatians 2 '
Acts                            21:  0 -   0:  0 results from 'Acts 21'
Hebrews                         13: 23 -   0:  0 results from 'Heb.13:23'
Hebrews                          2:  3 -   2:  4 results from 'Heb. 2:3-4'
Galatians                        1: 16 -   0:  0 results from 'Galatians 1:16'
Acts                            22: 17 -   0:  0 results from 'Acts 22:17'
Acts                            21: 28 -  21: 31 results from 'Acts 21:28-31'
Jeremiah                        31: 15 -   0:  0 results from 'Jeremiah 31:15'
Matthew                          5:  0 -   0:  0 results from 'Matthew 5, 6, '
Matthew                          6:  0 -   0:  0 results from 'Matthew 5, 6, '
I Peter                          2: 24 -   0:  0 results from '1 Peter 2:24  '
Isaiah                           7: 14 -   0:  0 results from 'Isaiah 7:14'
Genesis                         35: 19 -   0:  0 results from 'Gen 35:19'
Judges                          17:  0 -  18:  0 results from 'Judges 17-18'
Ruth                             1:  1 -   0:  0 results from 'Ruth 1:1, 2, 19, 22; 2:4; 4:11'
Ruth                             1:  2 -   0:  0 results from 'Ruth 1:1, 2, 19, 22; 2:4; 4:11'
Ruth                             1: 19 -   0:  0 results from 'Ruth 1:1, 2, 19, 22; 2:4; 4:11'
Ruth                             1: 22 -   0:  0 results from 'Ruth 1:1, 2, 19, 22; 2:4; 4:11'
Ruth                             2:  4 -   0:  0 results from 'Ruth 1:1, 2, 19, 22; 2:4; 4:11'
Ruth                             4: 11 -   0:  0 results from 'Ruth 1:1, 2, 19, 22; 2:4; 4:11'
I Samuel                        17: 12 -   0:  0 results from '1 Sam 17:12, 15'
I Samuel                        17: 15 -   0:  0 results from '1 Sam 17:12, 15'
II Chronicles                   11:  6 -   0:  0 results from '2 Chr 11:6'
James                            2:  8 -   0:  0 results from 'James 2:8 '
Galatians                        5: 14 -   0:  0 results from 'Gal 5:14, '
Romans                           8:  1 -   0:  0 results from 'Rom 8:1'
Galatians                        6:  7 -   6:  8 results from 'Gal 6:7-8 '
Acts                            24: 15 -   0:  0 results from 'Acts 24:15'
II Corinthians                   5: 19 -   0:  0 results from '2 Cor 5:19'
John                             4: 42 -   0:  0 results from 'John 4:42'
I John                           4: 14 -   0:  0 results from '1 John 4:14'
John                            16:  8 -   0:  0 results from 'John 16:8 '
Romans                           2: 15 -   0:  0 results from 'Romans 2:15 '
Romans                          13:  4 -   0:  0 results from 'Rom 13:4'
Romans                           1: 18 -   0:  0 results from 'Rom 1:18'
Romans                           2: 15 -   0:  0 results from 'Romans 2:15 '
Matthew                          5: 43 -   5: 48 results from 'Matt 5:43-48'
Acts                            24: 15 -   0:  0 results from 'Acts 24:15 '
II Corinthians                   5: 19 -   0:  0 results from '2 Cor 5:19'
John                             4: 42 -   0:  0 results from 'John 4:42 '
I John                           4: 14 -   0:  0 results from '1 John 4:14 '
Matthew                         25: 46 -   0:  0 results from 'Matthew 25:46  '
Romans                           2:  6 -   2: 10 results from 'Romans 2:6-10 '
Matthew                         25: 46 -   0:  0 results from 'Matthew 25:46  '
Romans                           2:  6 -   2: 10 results from 'Romans 2:6-10 '
John                             5:  0 -   0:  0 results from 'John 5'
Galatians                        6:  7 -   6:  8 results from 'Gal 6:7-8 '
John                             5:  0 -   0:  0 results from 'John 5'
John                             5: 24 -   0:  0 results from 'John 5:24'
John                             5: 28 -   5: 29 results from 'John 5:28-29 '
John                             5: 28 -   5: 29 results from 'John 5:28-29'
Romans                           8:  5 -   8:  8 results from 'Rom 8:5-8'
John                             5: 28 -   5: 29 results from 'John 5:28-29'
Acts                             2: 17 -   0:  0 results from 'Acts 2:17'
John                            16:  8 -   0:  0 results from 'John 16:8 '

User avatar
Perry
Posts: 328
Joined: Thu Jan 13, 2011 1:24 pm

Re: Wiki Question for Jarod and Thrombomodulin

Post by Perry » Thu Sep 06, 2012 3:21 pm

look2jesus wrote:You never said you were a computer geek! Hey buddy!
Hiya John!

I tinker with computers from time to time, but that really wasn't what this post was about. Throm had already written the scripts, I just realized that I was keying a lot of stuff that, if I would just key it in a way that was compatible with his scripts, would save me work in the long run.

I hope all is well with you, your wife, and your daughter. We really missed you those last few days of GCS.

Post Reply

Return to “General Bible Discussion”