|
|
|
|
|
by LoSboccacc
2474 days ago
|
|
your missing the point, you cannot nest them but you can have that comment both around or within a cdata, so that Regex is starting to look quite complex to maintain, unless you want to have multiple stages of Regex applied in sequence, at which point congratulation, your building a whole parser the hardest way and no I mean tool like antlr or javacc which build an in memory syntax tree you can query or observe. https://github.com/antlr/grammars-v4/blob/72810b7c59bb481750... this is different than querying the document as XML, since an empty node is equivalent to an empty element, but they differ in the syntax, so querying the syntax tree allowed you to know because it produces a TAG_SLASH_CLOSE |
|