fork download
  1. class T {
  2. public static void main(String[] args) {
  3. String lines =
  4. "#This is some text \n" +
  5. "#This is some text \n" +
  6. "This is some text I don't want to match\n";
  7. System.out.println(
  8. lines.replaceAll("(?m)^#.*\n", "")
  9. );
  10. }
  11. }
Success #stdin #stdout 0.1s 320576KB
stdin
Standard input is empty
stdout
This is some text I don't want to match