package com.valerysamovich.java.regex;

public class RegexMatches {
    
    public static void main(String args[]) {
        
        // String to be scanned to find the pattern
        String line = "This order was placed for QT3000! OK?";
        String pattern = "(.*)(\\d+)(.*)";
    }

}

package com.valerysamovich.java.regex;

import java.util.regex.*;

public class RegexMatches {
    
    public static void main(String args[]) {
        
        // String to be scanned to find the pattern.
        String line = "This order was placed for QT3000! OK?";
        String pattern = "(.*)(\\d+)(.*)";
        
        // Create a Pattern object.
        Pattern r = new Pattern();
        r.compile(pattern);
        
        // No create matcher object.
        Matcher m = r.matcher(line);
        
        // TO-DO: Test and Output... 
        
    }

}

Create Pattern object