package main import ( "regexp" "fmt" "bufio" "os" ) func main(){ rd := bufio.NewReaderSize(os.Stdin, 1000000) var reg [5]*regexp.Regexp reg[0] = regexp.MustCompile(`^digi\s.*[nN][yY][oO][^0-9a-zA-Z]{0,3}$`) reg[1] = regexp.MustCompile(`^petit\s.*[nN][yY][uU][^0-9a-zA-Z]{0,3}$`) reg[2] = regexp.MustCompile(`^gema\s.*[gG][eE][mM][aA][^0-9a-zA-Z]{0,3}$`) reg[3] = regexp.MustCompile(`^piyo\s.*[pP][yY][oO][^0-9a-zA-Z]{0,3}$`) reg[4] = regexp.MustCompile(`^rabi\s.*[0-9a-zA-Z].*$`) s,_,err := rd.ReadLine() for ; err == nil; { ok := false for _, r := range reg { if r.Match([]byte(s)) { ok = true } } if ok { fmt.Println("CORRECT (maybe)") }else { fmt.Println("WRONG!") } s,_,err = rd.ReadLine() } }