fork download
  1. import java.util.regex.*;
  2.  
  3. class rTest {
  4. public static void main (String[] args) {
  5. String text = "foo bar baz\n"
  6. + "keep this line\n"
  7. + "> remove this\n"
  8. + "> and this line\n"
  9. + "keep this line\n"
  10. + "and this ending line";
  11.  
  12. text = text.replaceAll("(?m)^>[^>]*?\n", "");
  13. System.out.println(text);
  14.  
  15. }
  16. }
Success #stdin #stdout 0.07s 380224KB
stdin
Standard input is empty
stdout
foo bar baz
keep this line
keep this line
and this ending line