parseAllReferences function

List<Reference> parseAllReferences(
  1. String stringReference
)

Finds all the references within a string. Returns an empty list when no references are found.

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

Returns a list of Reference objects with James 4:5 and Matthew 2:4

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

Implementation

List<Reference> parseAllReferences(String stringReference) {
  var refs = <Reference>[];
  var matches = _exp.allMatches(stringReference);
  matches.forEach((x) => refs.add(_createRefFromMatch(x)));
  return refs;
}