Files
mostlymatter/vendor/github.com/mattermost/morph/models/parse.go
Agniva De Sarker 2a59047d07 Moved morph dependency to new repo (#19618)
```release-note
NONE
```

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
2022-02-23 20:11:12 +05:30

24 строки
387 B
Go

package models
import (
"fmt"
"regexp"
)
// Direction is either up or down.
type Direction string
const (
Down Direction = "down"
Up Direction = "up"
)
var (
ErrParse = fmt.Errorf("no match")
)
// Regex matches the following pattern:
// 123_name.up.ext
// 123_name.down.ext
var Regex = regexp.MustCompile(`^([0-9]+)_(.*)\.(` + string(Down) + `|` + string(Up) + `)\.(.*)$`)