16120

RegEx

Mar 10th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.31 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class reg {
  4.  
  5.     public static void main(String[] args) {
  6.     Scanner sc = new Scanner(System.in);
  7.  
  8.     String text = "Email:[email protected], [email protected]";
  9.     String censored = text.replaceAll("[A-Za-z_-]+@[A-za-z]+\\.[a-zA-Z]+","*****@abv.bg");
  10.     System.out.println(censored);
  11.    
  12.     }
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment