How exactly do regular expressions work in Java? Let's say I have the string:



String test = new String("Sally went to the barn.");
//any string will do this is for experimentation purposes
...