diff options
Diffstat (limited to 'table/policy.go')
-rw-r--r-- | table/policy.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/table/policy.go b/table/policy.go index 68792a6c..20ae16cd 100644 --- a/table/policy.go +++ b/table/policy.go @@ -879,14 +879,14 @@ func ParseExtCommunity(arg string) (bgp.ExtendedCommunityInterface, error) { func ParseCommunityRegexp(arg string) (*regexp.Regexp, error) { i, err := strconv.Atoi(arg) if err == nil { - return regexp.MustCompile(fmt.Sprintf("^%d:%d$", i>>16, i&0x0000ffff)), nil + return regexp.MustCompile(fmt.Sprintf("%d:%d", i>>16, i&0x0000ffff)), nil } if regexp.MustCompile("(\\d+.)*\\d+:\\d+").MatchString(arg) { - return regexp.MustCompile(fmt.Sprintf("^%s$", arg)), nil + return regexp.MustCompile(fmt.Sprintf("%s", arg)), nil } for i, v := range bgp.WellKnownCommunityNameMap { if strings.Replace(strings.ToLower(arg), "_", "-", -1) == v { - return regexp.MustCompile(fmt.Sprintf("^%d:%d$", i>>16, i&0x0000ffff)), nil + return regexp.MustCompile(fmt.Sprintf("%d:%d", i>>16, i&0x0000ffff)), nil } } exp, err := regexp.Compile(arg) |