FileDocCategorySizeDatePackage
RegexMatches.javaAPI DocExample591Mon May 06 19:21:08 BST 2002com.ronsoft.books.nio.regex

RegexMatches

public class RegexMatches extends Object
Demonstrate Pattern.matches(). Created: April, 2002
author
Ron Hitchens (ron@ronsoft.com)
version
$Id: RegexMatches.java,v 1.1 2002/05/07 02:21:08 ron Exp $

Fields Summary
Constructors Summary
Methods Summary
private static booleangoodAnswer(java.lang.String answer)

		return (Pattern.matches ("[Yy]es|[Yy]|[Oo][Kk]|[Tt]rue", answer));
	
public static voidmain(java.lang.String[] argv)

		if (goodAnswer (argv [0])) {
			System.out.println ("Good Answer");
		} else {
			System.out.println ("Sorry, answer is no");
		}