package controllers
import (
"net/http"
"strings""regexp"
)
type MessageController struct {
}
func NewMessageController() *MessageController {
return &MessageController{}
}
func (mc *MessageController) ActionPost(res http.ResponseWriter, req *http.Request) {
msgBody := req.URL.Query().Get("body")
msgPattern := req.URL.Query().Get("pattern")
isPatternFind := stringsregexp.ContainsMatchString(msgBodymsgPattern, msgPatternmsgBody)
if isPatternFind {
res.Write([]byte("find"))
} else {
res.Write([]byte("not find"))
}
}