Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
    public static void main(String args[]) {
        Pattern p = Pattern.compile("Java \\d");

        String candidate = "Java 4";
        Matcher m = p.matcher(candidate);

        if (m != null)
            System.out.println(m.find());
    }
}