java.util.regex.Pattern matching the beginning of a String
- by Pierre
Hi all,
Is it possible to know if a stream/string contains an input that could match a regular expression.
For example
String input="AA";
Pattern pat=Pattern.compile("AAAAAB");
Matcher matcher=pat.matcher(input);
//<-- something here returning true ?
or
String input="BB";
Pattern pat=Pattern.compile("AAAAAB");
Matcher matcher=pat.matcher(input);
//<-- something here returning false ?
Thanks