// Collection of code snippets by Arne VajhÃ¸j 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.regex.Pattern;

public class ContainsWord {
    public static void main(String[] args) {
        String s = "far,mor,børn";
        System.out.println(Pattern.matches(".*\\bmor\\b.*", s));
        System.out.println(Pattern.matches(".*\\bmo\\b.*", s));
        System.out.println(Pattern.matches(".*\\bor\\b.*", s));
    }
}
