golang 则

How to write the 6-20 digit limit composed of alphanumeric underscore minus sign at the beginning of the letter:

package main

import (
	"fmt"
	"regexp"
)
var re ,_ = regexp.Compile("^[a-z]{1}[a-z0-9_-]{5,19}$")
func main() {
    
    
	fmt.Println(re.MatchString("1t123_-123"))
}

Guess you like

Origin blog.csdn.net/fwhezfwhez/article/details/106572384