Saturday, January 11, 2014

Finding the phrases of a string in Java

import java.util.regex.*;
public  class main{
p.s.v.m() t{
String search = "how are you";
Pattern p = Pattern.compil(search);
Matcher m = p.matcher("hello world how are you");
boolean b = m.find();
S.o.p(b);
if(b) S.o.p("found");
else
S.o.p("not found");
}
}

No comments: