Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- 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 = "[^abc]";
- String example = "Abraha87m";
- Pattern pattern = Pattern.compile(regex);
- Matcher matcher = pattern.matcher(example);
- String tiPrint = matcher.group(0).toString();
- System.out.print(tiPrint);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement