2022-12-25 10:56:58 +00:00
|
|
|
//go:build oniguruma
|
2018-08-28 15:27:18 +00:00
|
|
|
// +build oniguruma
|
|
|
|
|
|
|
|
package regex
|
|
|
|
|
|
|
|
import (
|
2020-03-19 16:31:29 +00:00
|
|
|
rubex "github.com/go-enry/go-oniguruma"
|
2018-08-28 15:27:18 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type EnryRegexp = *rubex.Regexp
|
|
|
|
|
2022-12-25 10:56:58 +00:00
|
|
|
func MustCompile(s string) EnryRegexp {
|
|
|
|
return rubex.MustCompileASCII(s)
|
|
|
|
}
|
|
|
|
|
|
|
|
// MustCompileMultiline matches in multi-line mode by default with Oniguruma.
|
|
|
|
func MustCompileMultiline(s string) EnryRegexp {
|
|
|
|
return MustCompile(s)
|
|
|
|
}
|
|
|
|
|
|
|
|
func MustCompileRuby(s string) EnryRegexp {
|
|
|
|
return MustCompile(s)
|
2018-08-28 15:27:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QuoteMeta(s string) string {
|
|
|
|
return rubex.QuoteMeta(s)
|
|
|
|
}
|