System.out.println(temp.replaceAll("(?!\')\\p{Punct}", " "));
Nothing is hard as long as you put your heart into it!