Save This Page
Home » struts-1.3.9-src » examples » awk » [javadoc | source]
examples.awk
public final class: matchesContainsExample [javadoc | source]
java.lang.Object
   examples.awk.matchesContainsExample
This is a test program demonstrating the difference between the OROMatcher matches() and contains() methods.
Method from examples.awk.matchesContainsExample Summary:
main
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from examples.awk.matchesContainsExample Detail:
 public static final  void main(String[] args) 
    A common mistake is to confuse the behavior of the matches() and contains() methods. matches() tests to see if a string exactly matches a pattern whereas contains() searches for the first pattern match contained somewhere within the string. When used with a PatternMatcherInput instance, the contains() method allows you to search for every pattern match within a string by using a while loop.