I am trying to match input data from the user and search if there is a match of this input. for example if the user type : A*B*C* i want to search all word which start with A and contains B and B i tried this code and it;s not working:(get output false)
public static void main(String[] args)
{
String envVarRegExp = "^A[^\r\n]B[^\r\n]C[^\r\n]";
Pattern pattern = Pattern.compile(envVarRegExp);
Matcher matcher = pattern.matcher("AmBmkdCkk");
System.out.println(matcher.find());
}
Thanks.
contains B and B? Did you meanB and C?