[agent-operator] - update dltu part

This commit is contained in:
zeaslity
2024-04-26 17:51:11 +08:00
parent 318a5a8026
commit 021690f5c4
12 changed files with 338 additions and 197 deletions

View File

@@ -2,6 +2,7 @@ package main
import (
"fmt"
"regexp"
"strings"
)
@@ -25,6 +26,17 @@ func splitTest() {
func main() {
splitTest()
inputList := []string{
"4.1.6-xxx",
"5.1.0",
"3.2.0-0123-123",
}
r, _ := regexp.Compile(`\d+.+\d+.+\d+`)
for _, input := range inputList {
matches := r.FindAllString(input, -1)
for _, match := range matches {
fmt.Println(match) // Output: 4.1.6 5.1.0 3.2.0
}
}
}