-
Notifications
You must be signed in to change notification settings - Fork 1
/
regexp.go
45 lines (34 loc) · 1.02 KB
/
regexp.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package regexp
import (
"github.com/vlorc/lua-vm/base"
"io"
"regexp"
)
type RegexpFactory struct{}
func (f RegexpFactory) New(expr string) (*regexp.Regexp, error) {
return f.Compile(expr)
}
func (RegexpFactory) Compile(expr string) (*regexp.Regexp, error) {
return regexp.Compile(expr)
}
func (RegexpFactory) CompilePOSIX(expr string) (*regexp.Regexp, error) {
return regexp.CompilePOSIX(expr)
}
func (RegexpFactory) Match(pattern string, b base.Buffer) (bool, error) {
return regexp.Match(pattern, b)
}
func (RegexpFactory) MatchReader(pattern string, r io.RuneReader) (bool, error) {
return regexp.MatchReader(pattern, r)
}
func (RegexpFactory) MatchString(pattern, s string) (bool, error) {
return regexp.MatchString(pattern, s)
}
func (RegexpFactory) MustCompile(str string) *regexp.Regexp {
return regexp.MustCompile(str)
}
func (RegexpFactory) MustCompilePOSIX(str string) *regexp.Regexp {
return regexp.MustCompilePOSIX(str)
}
func (RegexpFactory) QuoteMeta(str string) string {
return regexp.QuoteMeta(str)
}