This is an old revision of the document!
Using regular expressions will help you do some advanced querying and data manipulation. I've mostly used them in PostgreSQL.
I don't have any examples of code, but I have an uncompleted Javascript project where I use them a lot.
Here's some code that is a regular expression that will do forward and reverse lookups for “Book Chapter Verse(s)” ranges. This is Javascript here, but the patterns themselves won't change.
// Find all the range strings var pattern = ""; // pattern = pattern + "(Genesis|Leviticus) *"; pattern = pattern + "(" + p_book_titles + "|" + p_book_short_titles + ") *"; // Match Book c:v which is *always* the initial string var chapter_verse = "(\\d+:\\d+)"; pattern = pattern + chapter_verse; // Match possible Book c:v-v, c:v-v,v, c:v,v-v,v var following_verses = "(((( ?- ?|, ?)?\\d+)*(?!:))*)?"; pattern = pattern + following_verses; // Start all over again pattern = pattern + "(( ?(-|,|;) ?)?"; pattern = pattern + chapter_verse + following_verses + ")*"; var re = new RegExp(pattern, 'g');