Advertisement
SIRAKOV4444

Untitled

Apr 7th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import java.util.Scanner;
  2. import java.util.regex.Matcher;
  3. import java.util.regex.Pattern;
  4.  
  5. public class practice {
  6. public static void main(String[] args) {
  7. Scanner sc = new Scanner(System.in);
  8. String regex = "[^abc]";
  9. String example = "Abraha87m";
  10.  
  11. Pattern pattern = Pattern.compile(regex);
  12. Matcher matcher = pattern.matcher(example);
  13.  
  14. String tiPrint = matcher.group(0).toString();
  15. System.out.print(tiPrint);
  16.  
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement