fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. System.out.println(validateAddress("Test C\\O good:product"));
  10. }
  11. public static boolean validateAddress(String address) {
  12. return address.matches("^[a-zA-Z0-9~`!@#$%^&*()_+={|}:;'<,>?\\\\ /\"\t\n\\[\\] .-]*$");
  13. }
  14.  
  15. }
Success #stdin #stdout 0.06s 711168KB
stdin
Standard input is empty
stdout
true