Files
dpi/protocol/match_example_test.go
2025-10-09 17:58:40 +02:00

21 lines
522 B
Go

package protocol_test
import (
"fmt"
"git.maze.io/go/dpi/protocol"
)
func ExampleMatch() {
fmt.Println(protocol.Match("t?s?", []byte("test")))
fmt.Println(protocol.Match("t?s?", []byte("test with more data")))
fmt.Println(protocol.Match("t?s?", []byte("text with more data")))
fmt.Println(protocol.Match("select * from user", []byte("select an apple from user")))
fmt.Println(protocol.Match("select * from user", []byte("select an apple from the user")))
// Output: true
// true
// false
// true
// false
}