replace all instances of < and > but not text between them
How to extract the text between tags?
to get text inbetween tags, the below code works fine,
System.out.println("<text>google<text/>".replaceAll("<[^>]*>", "")); //
gives google
Am trying the same for < and >. Am I missing anything for the below
code?
System.out.println("<aksdk>google<aksdk>".replaceAll("<[^.]*>",
""));
PS: Am not using this for html parsing.
No comments:
Post a Comment