Source code

Revision control

Copy as Markdown

Other Tools

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