首次提交:初始化项目代码

This commit is contained in:
sunct
2026-07-31 15:18:32 +08:00
commit d6393266b0
193 changed files with 14287 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
package main
import (
"fmt"
"regexp"
)
var userRegex = regexp.MustCompile(`姓名:([\p{Han}a-zA-Z0-9]+),年龄:(\d+),电话:(\d{11})`)
func main() {
text := "用户信息:姓名:孙三苗,年龄:20,电话:11112345678" // 号码不存在仅供测试
match := userRegex.FindStringSubmatch(text)
if len(match) > 0 {
fmt.Println("完整匹配:", match[0])
fmt.Println("姓名:", match[1])
fmt.Println("年龄:", match[2])
fmt.Println("电话:", match[3])
}
}