Java tutorial
//package com.java2s; public class Main { public static boolean ValidatePassword(String password) { return (password.matches("^[\\w!@#\\$%\\^&\\*\\(\\)]{4,12}$")); } }