fork(1) download
  1. class Ideone {
  2. public static void main (String[] args) {
  3. String[] tests = {
  4. "Hi I have a dog named Patch",
  5. "I have a dog named ALPHA",
  6. };
  7. for (String str : tests) {
  8. str = str.replaceAll("(?i)^[^aeiou]*|[^aeiou]*$", "");
  9. System.out.println(str);
  10. }
  11. }
  12. }
Success #stdin #stdout 0.09s 47752KB
stdin
Standard input is empty
stdout
i I have a dog named Pa
I have a dog named ALPHA