This is a two-part question:
First, given
txt = "the quick brown fox jumps over the lazy dog"
Why does this repeated pattern match both instances:
txt // StringCases[(t : "the") .. :> t]
{"the", "the"}
Yet this matches only the 2nd instance?
txt // StringCases[(pre___ ~~ t : "the" ~~ post___) .. :>
Row[{pre, Style[t, Red], post}]]
{"the quick brown fox jumps over (the) lazy dog"}
(* note output above uses: pre <> "(" <> t <> ")" <> post *)
Second, provided the first part is solved, what's the best way to output a single string with all instances highlighted, rather than a list of matches?