Slicey provides two simple ways to associate data with parts of a string:
Spanned
Sliced
See their documentation for more info.