Register patterns to find tokens in a string and map them to unique IDs, allowing them to be extracted, replaced or restored.