fork(1) 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 s = "This is my \"te\n\nst\" case\nwith lines for \"tes\"t\"ing\" with regex\nBut as he said \"It could be an arbitray ammount of words\"";
  11. System.out.println(s.replaceAll("\\B\"\\b(.*?)\\b\"\\B", "\\\\q{$1}"));
  12.  
  13. }
  14. }
Success #stdin #stdout 0.07s 33712KB
stdin
Standard input is empty
stdout
This is my "te

st" case
with lines for \q{tes"t"ing} with regex
But as he said \q{It could be an arbitray ammount of words}