michael@0: // don't crash michael@0: var book = 'Ps'; michael@0: var pattern = "(?:" michael@0: + "(?:" michael@0: + "(?:" michael@0: + "(?:-|)" michael@0: + "\\s?" michael@0: + ")" michael@0: + "|" michael@0: + ")" michael@0: + " ?" michael@0: + "\\d+" michael@0: + "\\w?" michael@0: + ")*"; michael@0: var re = new RegExp(pattern); michael@0: '8:5-8'.match(re);