This might be overkill, but try looking up AWK, it can do this kind of things pretty easily since it's centered around processing text.
You can also write a custom parsing script like
string s = "Visit <a href="www.htz.hr">Croatia</a> this summer."
result = ""
slice_limit = 9
i= 0
j = 0
in_tag = false
while i < slice_limit and j < s.size do
if s[j] == "<" then in_tag = true
if in_tag and s[i]==">" then in_tag = false
if !in_tag then i++
result += s[j]
end
... or something like that (haven't tested, but it gives you the idea).
EDIT: You will also have to add something to detect if the tag is closed or not (just add a flag like in_tag and mix it with some regular expression and it should work)
Hope that helps
EDIT2: if you gave the language you want to use, that could be helpful. javascript?