示例#1
0
func (self Any) Index(s string) (int, []int) {
	found := strings.IndexAnyRunes(s, self.Separators)
	switch found {
	case -1:
	case 0:
		return 0, segments0
	default:
		s = s[:found]
	}

	segments := acquireSegments(len(s))
	for i := range s {
		segments = append(segments, i)
	}
	segments = append(segments, len(s))

	return 0, segments
}
示例#2
0
func (self Any) Match(s string) bool {
	return strings.IndexAnyRunes(s, self.Separators) == -1
}