> How about split up the value into individual words and keep their orders? > add words up to form individual phrase and ensure that each phrase only consists unique/distinct words > count repeated phrases afterward > > How about this? Sure, if that serves your purpose ? So far, we (I?) can't tell because you have yet to (computably) define "phrase". Which may or may not solve the previous dilemma. (Top-posting is not liked on this list, to my knowledge.) Best, Karsten