Just wondering if there is a set of design patterns for complex string manipulations?
Basically the problem I'm trying to solve is that I need to read a line, for example:
"[name_of_kicker] is looking at the punch, but under some real pressure from the players [name_of_defending_team] he gets a punch [length_of_kick], but he is in full contact."
or
"[name_of_kicker] gets the ball from [name_of_passer] and fires the bomb. [name_of_kicker] really made good contact, he was given a couple of [name_of_attacking_team] chasers enough time to get under the ball when he goes down."
And replace each "tag" with a possible value and check if the string is equal to the other string.
So, for example, any tag that represents the player, I need to replace any of the 22 string values that represent the player. But I should also be able to make sure that I went through every combination of players for the various tags that I can find in the line. NOTE. Tags listed in the above two samples are not the only signs, there are many others that may appear in any sentence.
I tried to create a loading of nested loops to go through a collection of players, etc. and try to replace tags every time, but with many tag features, I just created one nested loop for another, and it became unmanageable, and I also suspect it is inefficient, since I need to scroll over 1000 base lines, as above, and replace markup tags with players, etc. for each of them ...
So, are there any String manipulation patterns that I could learn, or does anyone have any possible solutions to solve such a problem.