/**
 * THE RegexTester.java WRITEME...
 */
package org.starhope.appius.test;

import java.util.Scanner;
import java.util.regex.Pattern;

/**
 * WRITEME: Document this type. theys Jan 15, 2010
 * 
 * @author <a href="mailto:theys@resinteractive.com">Tim Heys</a>
 * 
 */
public class RegexTester {

	/**
	 * Enter a pattern to test
	 */
	public static Pattern pattern;

	/**
	 * WRITEME: Document this field. theys Jan 15, 2010
	 */
	private static final String regex = "^[a-zA-Z\\.,!\\?\\\"\\\' -]*$";

	/**
	 * 
	 */
	private static Scanner scan = new Scanner (System.in);

	/**
	 * 
	 * <pre>
	 * theys Jan 15, 2010
	 * </pre>
	 * 
	 * TO main WRITEME...
	 * 
	 * @param args
	 */
	public static void main (final String args[]) {
		pattern = Pattern.compile (regex);
		String input = "";
		while (true) {
			System.out.println ("Enter a string to match the pattern");
			input = scan.nextLine ();
			if (pattern.matcher (input).matches ()) {
				System.out.println (input + " matches " + regex);
			} else {
				System.out.println (input + " does not match " + regex);
			}
		}
	}
}
