/* * Created on Aug 5, 2003 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ /** * @author student * * To change the template for this generated type comment go to * */ package TestClasses; /** * @author student * * This class is being used for testing validation of a string using regular * expressions. * */ public class ValidationTest { /** * Method: main * This method is being used for checking a particular regular * expression. * @param args arguments, not used. * @return void */ public static void main(String[] args) { String message = ""; String test = "Sameer Mitra"; if (!test.matches("^[a-zA-Z/(/)/'/-/0-9/s/ ]+$")) { message = "Card Holder name has invalid characters."; } System.out.println("Test : " + message); } }