// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.regex.*;

public class Find {
   public static void main(String[] args) {
      String s = "Dette er en String til \"test\".";
      int ix1 = s.indexOf('"');
      int ix2 = s.indexOf('"', ix1 + 1);
      String del = s.substring(ix1 + 1, ix2);
      System.out.println(del);
      Pattern p = Pattern.compile("(?:\")(.*)(?:\")");
      Matcher m = p.matcher(s);
      while (m.find()) {
         System.out.println(m.group(1));
      }
   }
}
