fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4. import java.util.regex.*;
  5.  
  6. class Ideone
  7. {
  8. public static void main (String[] args) throws java.lang.Exception
  9. {
  10. String original = "<b>hello!</b><br><br><b><u>this is an example</u></b><br>";
  11. String separator = "(?!^)(?:(?<=>)|(?=<))";
  12. String[] results = original.split(separator);
  13. System.out.println(Arrays.toString(results));
  14. }
  15. }
Success #stdin #stdout 0.09s 48060KB
stdin
Standard input is empty
stdout
[<b>, hello!, </b>, <br>, <br>, <b>, <u>, this is an example, </u>, </b>, <br>]