[agent-operator] - update dltu part
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user