java - Split long string on "> -
i'm trying use split()
method split long string containing repeated tags (content of text document containing cfml code), each of terminates 2 chars: ">
, line break.
i cannot figure out how accomplish that, trying multiple regexes no luck, inside of mentioned tags there can nested other tags ( please don't ask why :-) ), , split breaks on nested tags, if not contain ">
example:
<cfset code = "text text text <table style='width:538px; [... more text stripped ...] </table>"> <cfset another_code = "text text text"> ...
any clues appreciated!
to pure regex, use str.split(pattern.quote("\">"))
.
however, should consider using xml parser such sax, stax, dom parser, etc. there's no need reinvent wheel.
Comments
Post a Comment