Q:

Grab word out of sentence

I've seen "split string" for this sort of thing, but I need something specific. I need the program to identify if the user put in a specific word into a sentence. I'm using it to program a very, VERY shoddy, basic AI program.
If the user inputs something like, "What is your name?" it will recognize that the user said "name" and go to a random name generator. 
What is the code for grabbing a specific word (ignoring case) from a sentence so I can use it later (like in an if-else or something)?

A:

it is possible to use Regex that support word boundary in Java
Pattern patt = Pattern.compile("\\bname\\b");
Matcher m = patt.matcher(" v padaname bla");    
System.out.println(m.find());
m = patt.matcher(" your name?");    
System.out.println(m.find());

