parseReference function

Reference parseReference(
  1. String stringReference
)

Finds the first reference from within a string.

parseReference('I love James 4:5 and Matthew 2:4');

Returns a Reference object of James :45.

Note: The word 'is' will be parsed as the book of Isaiah. An efficient workaround is in the works.

Implementation

Reference parseReference(String stringReference) {
  var match = _exp.firstMatch(stringReference);
  if (match == null) return Reference('');
  return _createRefFromMatch(match);
}