Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import java.util.regex.Matcher;
- import java.util.regex.Pattern;
- public class practice {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- String regex = "(\\d+)";
- String example = "ALEX494949";
- Pattern pattern = Pattern.compile(regex);
- Matcher matcher = pattern.matcher(example);
- String tiPrint = matcher.group();
- System.out.printf(tiPrint);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement