The Diff Match and Patch libraries offer robust algorithms to

  • Compare two blocks of plain text and efficiently return a list of differences.
  • Find a search string’s best fuzzy match in a block of plain text, weighted for both accuracy and location.
  • Apply a list of patches onto plain text using best-effort to apply patch even when the underlying text doesn’t match.

Official Diff Match Patch web site

Official Diff Match Patch Objective C repository