需要一个正则

This commit is contained in:
qaqland 2022-01-15 17:01:37 +08:00
parent c0c60ce5a7
commit 179cf24fba
2 changed files with 12 additions and 2 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
a.nex
test.go

View file

@ -1,6 +1,8 @@
package main package main
import "fmt" import (
"fmt"
)
type charset struct { type charset struct {
Name string Name string
@ -22,7 +24,7 @@ func fas_sum() []dna {
func fas_count(sum_nex []dna) []charset { func fas_count(sum_nex []dna) []charset {
fas_charset := []charset{} fas_charset := []charset{}
for k, v := range sum_nex { for k, v := range sum_nex {
n := v.name n := fas_name(v.name)
f := 1 f := 1
if k != 0 { if k != 0 {
f = fas_charset[k-1].To + 1 f = fas_charset[k-1].To + 1
@ -35,3 +37,9 @@ func fas_count(sum_nex []dna) []charset {
fmt.Println(fas_charset) fmt.Println(fas_charset)
return fas_charset return fas_charset
} }
func fas_name(old_name string) string {
// 需要 最后一个/开始,一个.结束 中间的部分
// 正则表达式
return old_name
}