import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public final class Benchmark {

    private static final String PATTERN_EMAIL = "[\\w.+-]+@[\\w.-]+\\.[\\w.-]+";
    private static final String PATTERN_URI = "[\\w]+://[^/\\s?#]+[^\\s?#]+(?:\\?[^\\s#]*)?(?:#[^\\s]*)?";
    private static final String PATTERN_IP = "(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9])\\.){3}" +
                                             "(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9])";

    public static void main(String... args) throws IOException {
        if (args.length != 1) {
            System.out.println("Usage: java Benchmark <filename>");
            System.exit(1);
        }

        final String data = Files.readString(Paths.get(args[0]));

        measure(data, PATTERN_EMAIL);
        measure(data, PATTERN_URI);
        measure(data, PATTERN_IP);
    }

    private static void measure(String data, String pattern) {
        long startTime = System.nanoTime();

        final Matcher matcher = Pattern.compile(pattern).matcher(data);
        int count = 0;
        while (matcher.find()) {
            ++count;
        }

        long elapsed = System.nanoTime() - startTime;

        System.out.println(elapsed / 1e6 + " - " + count);
    }
}

@@ -177,385 +177,8 @@
 k %7B%0A
-%0A    private static final String PATTERN_EMAIL = %22%5B%5C%5Cw.+-%5D+@%5B%5C%5Cw.-%5D+%5C%5C.%5B%5C%5Cw.-%5D+%22;%0A    private static final String PATTERN_URI = %22%5B%5C%5Cw%5D+://%5B%5E/%5C%5Cs?#%5D+%5B%5E%5C%5Cs?#%5D+(?:%5C%5C?%5B%5E%5C%5Cs#%5D*)?(?:#%5B%5E%5C%5Cs%5D*)?%22;%0A    private static final String PATTERN_IP = %22(?:(?:25%5B0-5%5D%7C2%5B0-4%5D%5B0-9%5D%7C%5B01%5D?%5B0-9%5D%5B0-9%5D)%5C%5C.)%7B3%7D%22 +%0A                                             %22(?:25%5B0-5%5D%7C2%5B0-4%5D%5B0-9%5D%7C%5B01%5D?%5B0-9%5D%5B0-9%5D)%22;%0A%0A
     
@@ -470,92 +470,238 @@
 ta, 
-PATTERN_EMAIL);%0A        measure(data, PATTERN_URI);%0A        measure(data, PATTERN_IP
+%22%5B%5C%5Cw.+-%5D+@%5B%5C%5Cw.-%5D+%5C%5C.%5B%5C%5Cw.-%5D+%22);%0A        measure(data, %22%5B%5C%5Cw%5D+://%5B%5E/%5C%5Cs?#%5D+%5B%5E%5C%5Cs?#%5D+(?:%5C%5C?%5B%5E%5C%5Cs#%5D*)?(?:#%5B%5E%5C%5Cs%5D*)?%22);%0A        measure(data, %22(?:(?:25%5B0-5%5D%7C2%5B0-4%5D%5B0-9%5D%7C%5B01%5D?%5B0-9%5D%5B0-9%5D)%5C%5C.)%7B3%7D(?:25%5B0-5%5D%7C2%5B0-4%5D%5B0-9%5D%7C%5B01%5D?%5B0-9%5D%5B0-9%5D)%22
 );%0A 

Put patterns directly in function call to follow style of the rest of benchmarks