// 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.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Find {
    private static final Pattern p = Pattern.compile("user_pref\\(\"network.proxy.type\", ([0-9]+)\\);");
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("C:\\test.js"));
        String line;
        while((line = br.readLine()) != null) {
            System.out.println(line);
            Matcher m = p.matcher(line);
            if(m.find()) {
                System.out.println("bingo ! (number=" + m.group(1) + ")");;
            }
        }
        br.close();
    }
}
