/*** * caseTest.java,v 1.2 1997/06/23 11:10:34 dfs Exp * Copyright 1997 ORO, Inc. All rights reserved. ***/ import com.oroinc.text.regex.*; public final class caseTest { public final static void main(String args[]) { Pattern pattern; Perl5Compiler compiler; PatternMatcher matcher; MatchResult result; compiler = new Perl5Compiler(); matcher = new Perl5Matcher(); try { pattern = compiler.compile("fooBAR", Perl5Compiler.CASE_INSENSITIVE_MASK); } catch(MalformedPatternException e) { System.err.println("Bad pattern."); System.err.println(e.getMessage()); return; } if(matcher.matches("fOObar", pattern)) System.out.println("Case insensitivity works."); else System.out.println("Case insensitivity does not work."); if(matcher.contains("This sentence contains FooBAr, a very strange word", pattern)) { System.out.println("Case insensitivity works."); result = matcher.getMatch(); System.out.println("Match: " + result); } else System.out.println("Case insensitivity does not work."); } }