Real problem:
str = "aa <12> bb <c> ąą <123> dd"
r = r"<.+?>"
mask = BitArray((0, 1, 1))
m = collect(eachmatch(r, str))[mask]
idx = (m .|>
o -> [o.offset, o.offset+length(o.match)-1]) |>
o -> reduce(vcat, o)
res = String(deleteat!(collect(str), idx))
"aa <12> bb c ąą <13> d"
“<>” is correctly removed from “<c>”, but not from “<123>”