I have some strings in a python script, they look like
<tag1> thisIsSomeText <otherTag>, <tag1>!
I want to parse these lines, and replace every tag by a string from a dictionary.
Assume my dict looks like:
tag1: Hello
otherTag: Goodbye
Then the output line should look like:
Hello thisIsSomeText Goodbye, Hello!
As one can see, the tags (and its braces) are replaced. Multiple occurences are possible.
In C, I would search for '<', remember its position, search for the '>', do some ugly string manipulation... But i guess, Python has better solutions for this.
Maybe Regex? Well, I hope my task is simple enough that I could be solved without regex. But I have no plan how to start in Python. Any suggestions?