So I've got this kind of note-tag:
<tagName> type: skill id: 2 <condition> some formula on multiple lines </condition> forced: true</tagName>"condition" is a nested tag.My note-tag format will have at most one-level of nesting (so you won't have tags nested within tags)
But I'm not sure how to parse the body of the tag.
I use this expression to find valid tags:
/<tagName>(.*?)<\/tagName>/imBut now when it comes time to parse the body, how would that be done?If it was just
I would just split on new-lines and then iterate over each line, but this approach doesn't really work when I introduce more a more complicated structure.
<tagName> type: skill id: 2 <condition> some formula on multiple lines </condition> forced: true</tagName>"condition" is a nested tag.My note-tag format will have at most one-level of nesting (so you won't have tags nested within tags)
But I'm not sure how to parse the body of the tag.
I use this expression to find valid tags:
/<tagName>(.*?)<\/tagName>/imBut now when it comes time to parse the body, how would that be done?If it was just
Code:
<tagName>type: skillid: 2forced: true</tagName>