/*
patString: it$
input: this is it
the output at 2 to the match operation at 1 is false, why?
*/
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.io.Console;
public class Test {
public static void main(String args[]) {
Console con = System.console();
String patString, input;
patternString = con.readLine("Enter pattern: "); //pattern
input = con.readLine("input: "); // input string to match against pattern
Pattern pattern = Pattern.compile(patString);
Matcher matcher = pattern.matcher(input);
boolean testMatch = matcher.matches(); //1
System.out.println("match found: " + testMatch); //2
}
}