Skip to main content
spindrift8106426
Participant
March 7, 2019
Answered

GREP Help: Finding Bible Verse References

  • March 7, 2019
  • 1 reply
  • 1027 views

I occasionally work with long manuscripts that feature a number of Bible verse references. Typically, I manually select these to change the character style, so I was wondering if I could speed up the process.

I only found one reference online to someone trying to do something like this with GREP, but the string doesn’t seem to find any results in my documents. Appreciate any help.

Build a biblical reference index with GREP

(d+s)?(w+?.?sd+[[:punct:]]d+)(.d+)?([,sd]+(.d+)?)*

    This topic has been closed for replies.
    Correct answer Laubender

    Hi spindrift ,

    you could use Jongware's script WhatTheGrep.jsx to see what your GREP pattern is aiming at:

    Indesign GREP Help

    Here the result as screenshot:

    Maybe that makes sense for you. It does not for me. E.g I suppose that the contents of the first group should be:

    (\d+\s) and not (d+s), because the source of the GREP was posted at indesignsecrets.com and all the escape characters \ were not made available by the forum software there. Best verify that with the original poster of the pattern.

    Regards,
    Uwe

    1 reply

    LaubenderCommunity ExpertCorrect answer
    Community Expert
    March 7, 2019

    Hi spindrift ,

    you could use Jongware's script WhatTheGrep.jsx to see what your GREP pattern is aiming at:

    Indesign GREP Help

    Here the result as screenshot:

    Maybe that makes sense for you. It does not for me. E.g I suppose that the contents of the first group should be:

    (\d+\s) and not (d+s), because the source of the GREP was posted at indesignsecrets.com and all the escape characters \ were not made available by the forum software there. Best verify that with the original poster of the pattern.

    Regards,
    Uwe

    spindrift8106426
    Participant
    March 7, 2019

    Yes, I used something like that script and could not understand the results either. The goal is to make something that would find something like Romans 3:15 or 2 Corinthians 4:16 or any of the ways those patterns could be altered (e.g. Ro. 3:15 or Rom. 3:15 or Ro. 3.15 or Rom. 3.1-5, 6, 7, 18).

    I think you're right about (\d+\s)​. That first part is explained as supposed to be looking for a digit or a blank space, in case the reference doesn't start with a number. Maybe other escape characters are missing, too?

    Edit:

    Laubender I went through and checked for missing escape characters. Now, the code seems to be working as the original author intended it to! Thank you for bringing that detail to my attention.

    (\d+\s)?(\w+?.?\s\d+[:]\d+)(.\d+)?([,\s\d]+(.\d+)?)*

    From here, I need to figure out how to add looking for Roman numerals (or 1-2 instances of the letter "I"), to cover instances of something like I Corinthians or II Corinthians. Then, how to include the next complete word after the reference, in case a translation is mentioned (e.g. ESV or NKJ).