// 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) 
public class RegexWord {
    public static void test(String s) {
        System.out.println(s.replaceFirst("måske", ""));
        System.out.println(s.replaceFirst("\\bmåske\\b", ""));
    }
    public static void main(String[] args) {
        test("abc måske def");
        test("abc måske");
        test("måske def");
        test("abc xmåskex def");
        test("abc xmåske def");
        test("abc måskex def");
    }
}
