I really don't know what you're trying to say here I'm afraid.
You need to (probably) provide some sample data here (Saying my data is "like" this doesn't mean anything, and doesn't help), and show what your goal is.
It's also worth noting that HTML doesn't use brackets for it's Markup. [tab] isn't HTML; HTML uses < and > for it's Markup. so, for example, <br /> is a line break. On the other hand, if you're saying that [tab] is for the TAB key, then one way of writing it in html would be:
So, if you're mixing characters (TAB (your [tab])) and markup (Line Break (your [enter]) then this is really confusing the matter. This sounds more like you need something else to parse your unique markup language.
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.