Community Patterns

Community Library Entry

2

Regular Expression
Created·2016-03-02 11:01
Flavor·ECMAScript (JavaScript)

/
((?:[1234]\s?)?[a--я]+)(\s?\d+(?::(?:\d+[—–-]\d+|\d+)(?:,\d+[—–-]\d+|,\d+)*(?:;\s?\d+(?::(?:\d+[—–-]\d+|\d+)(?:,\d+[—–-]\d+|,\d+)*|;))*)?)
/
ig
Open regex in editor

Description

Matches biblical strings in text. Two capture groups are used - one for the books name and another for the passages of the same book.

  • RegEx is long because it is strict!!!
  • If you want to also match books names without specified chapter and verses use: /((?:[1234]\s?)?[a-zа-я]+)(\s?\d+(?::(?:\d+[—–-]\d+|\d+)(?:,\d+[—–-]\d+|,\d+)(?:;\s?\d+(?::(?:\d+[—–-]\d+|\d+)(?:,\d+[—–-]\d+|,\d+)|;))*)?)?/ig
Submitted by Desislavsd