package main
import (
"regexp"
"fmt"
)
func main() {
s := "runcmd -name abcd xyz -descr abc def"
re1 := regexp.MustCompile(`^(.*? -name\b).*?(-descr\b.*)?$`)
result := re1.FindStringSubmatch(s)
fmt.Printf(result[1] + "..." + result[2])
fmt.Printf("\n")
s2 := "runcmd -name abcd xyz"
result2 := re1.FindStringSubmatch(s2)
fmt.Printf(result2[1] + "..." + result2[2])
}
cGFja2FnZSBtYWluICAKIAppbXBvcnQgKAogICAgInJlZ2V4cCIKICAgICJmbXQiCikKIApmdW5jIG1haW4oKSB7CiAgICBzIDo9ICJydW5jbWQgLW5hbWUgYWJjZCB4eXogLWRlc2NyIGFiYyBkZWYiCglyZTEgOj0gcmVnZXhwLk11c3RDb21waWxlKGBeKC4qPyAtbmFtZVxiKS4qPygtZGVzY3JcYi4qKT8kYCkKCXJlc3VsdCA6PSByZTEuRmluZFN0cmluZ1N1Ym1hdGNoKHMpCglmbXQuUHJpbnRmKHJlc3VsdFsxXSArICIuLi4iICsgcmVzdWx0WzJdKQoJCglmbXQuUHJpbnRmKCJcbiIpCgkKCXMyIDo9ICJydW5jbWQgLW5hbWUgYWJjZCB4eXoiCglyZXN1bHQyIDo9IHJlMS5GaW5kU3RyaW5nU3VibWF0Y2goczIpCglmbXQuUHJpbnRmKHJlc3VsdDJbMV0gKyAiLi4uIiArIHJlc3VsdDJbMl0pCn0=